{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "SAGE_Conv.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "id": "Sts89yazHHrv",
        "colab_type": "code",
        "outputId": "0853bc70-e972-476c-96ed-4d97c3f3a134",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "import torch\n",
        "torch.cuda.is_available()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "True"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 2
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "-8JezKsmHp5H",
        "colab_type": "code",
        "outputId": "967a90f9-c8e3-480d-fed7-e1f32db835bf",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        }
      },
      "source": [
        "!pip install --verbose --no-cache-dir torch-scatter \n",
        "!pip install --verbose --no-cache-dir torch-sparse \n",
        "!pip install --verbose --no-cache-dir torch-cluster \n",
        "!pip install --verbose --no-cache-dir torch-spline-conv\n",
        "!pip install torch-geometric"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Created temporary directory: /tmp/pip-ephem-wheel-cache-8ww75t66\n",
            "Created temporary directory: /tmp/pip-req-tracker-4_c_6b_n\n",
            "Created requirements tracker '/tmp/pip-req-tracker-4_c_6b_n'\n",
            "Created temporary directory: /tmp/pip-install-5uyziksa\n",
            "Collecting torch-scatter\n",
            "  1 location(s) to search for versions of torch-scatter:\n",
            "  * https://pypi.org/simple/torch-scatter/\n",
            "  Getting page https://pypi.org/simple/torch-scatter/\n",
            "  Found index url https://pypi.org/simple\n",
            "  Starting new HTTPS connection (1): pypi.org:443\n",
            "  https://pypi.org:443 \"GET /simple/torch-scatter/ HTTP/1.1\" 200 1104\n",
            "  Analyzing links from page https://pypi.org/simple/torch-scatter/\n",
            "    Found link https://files.pythonhosted.org/packages/29/96/566ac314e796d4b07209a3b88cc7a8d2e8582d55819e33f72e6c0e8d8216/torch_scatter-0.3.0.tar.gz#sha256=9e5e5a6efa4ef45f584e8611f83690d799370dd122b862646751ae112b685b50 (from https://pypi.org/simple/torch-scatter/), version: 0.3.0\n",
            "    Found link https://files.pythonhosted.org/packages/6a/b0/ecffacddf573c147c70c6e43ce05d24f007155ce3fb436959d3d2a24da46/torch_scatter-1.0.2.tar.gz#sha256=ccda794c25265b3450206b7fb0bf74f16a0b45f3f72d9547a42e44648a32faee (from https://pypi.org/simple/torch-scatter/), version: 1.0.2\n",
            "    Found link https://files.pythonhosted.org/packages/08/09/07b106f3e74246f4ecf6517013a053b6dd7486c4f889d81f39adc662431f/torch_scatter-1.0.3.tar.gz#sha256=e626993194819ba65cdf89a52fbbb7780569d9e157bc63dbef13ead6b7a33930 (from https://pypi.org/simple/torch-scatter/), version: 1.0.3\n",
            "    Found link https://files.pythonhosted.org/packages/2d/70/df2bc259d9606f00854ca43b6839f9047ec44900563435e0067584c93864/torch_scatter-1.0.4.tar.gz#sha256=ec004d687e47da9d5477407849d815629fc8b571ee87aeeebf6af8ed6f16defc (from https://pypi.org/simple/torch-scatter/), version: 1.0.4\n",
            "    Found link https://files.pythonhosted.org/packages/2f/97/c50a6aeaedc6924180c6f5810d2a7405ce11aa9b82ba4284badad549d665/torch_scatter-1.1.0.tar.gz#sha256=e534cc2ecb2f9d9b559b1513cd411737d26ea5585d1d65ff571fec55f42a49de (from https://pypi.org/simple/torch-scatter/), version: 1.1.0\n",
            "    Found link https://files.pythonhosted.org/packages/91/5f/eb1d3ef3810cb1165859d40db4d9ee6d7f1dfef97d7e5c34010055f43d95/torch_scatter-1.1.1.tar.gz#sha256=9db7f2c0a5cddf6cfde633e33db7c2c94eaab163e9f8edb46460d6414cc97917 (from https://pypi.org/simple/torch-scatter/), version: 1.1.1\n",
            "    Found link https://files.pythonhosted.org/packages/d4/83/67eeea00c2db1959e2ff95d8680dbd756977bfab254bda8658f09dc3bc11/torch_scatter-1.1.2.tar.gz#sha256=766c2476f5da5ffc25fa8e249ccf50f594031cdce3922abb23559e8e3b14337a (from https://pypi.org/simple/torch-scatter/), version: 1.1.2\n",
            "    Found link https://files.pythonhosted.org/packages/07/c0/f7ac424496f4a3bcb31aa993fba29077a6d42fc2624c66e90b58a566a98e/torch_scatter-1.2.0.tar.gz#sha256=3a0259105d07d264c740eec8e4267260a5c144cf55472abd26022fff4fd73281 (from https://pypi.org/simple/torch-scatter/), version: 1.2.0\n",
            "    Found link https://files.pythonhosted.org/packages/24/b7/680c3b392a4b55a0ebfb480aabb0d5c188e94bb21790104175c8cd614947/torch_scatter-1.3.0.tar.gz#sha256=bf7d561b8ef12b39a99f5797c90b989a0ce2c3ee4de74dff3b170f2d8566e1d4 (from https://pypi.org/simple/torch-scatter/), version: 1.3.0\n",
            "    Found link https://files.pythonhosted.org/packages/35/d4/750403a8aa32cdb3d2d05849c6a10e4e0604de5e0cc94b81a0d0d69a75f3/torch_scatter-1.3.1.tar.gz#sha256=54cbad248350165ddc921ded3fe7a69be5d30c6536273a1a3282e375289f86ec (from https://pypi.org/simple/torch-scatter/), version: 1.3.1\n",
            "  Given no hashes to check 10 links for project 'torch-scatter': discarding no candidates\n",
            "  Using version 1.3.1 (newest of versions: 0.3.0, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.3.0, 1.3.1)\n",
            "  Created temporary directory: /tmp/pip-unpack-0x7bwis1\n",
            "  Starting new HTTPS connection (1): files.pythonhosted.org:443\n",
            "  https://files.pythonhosted.org:443 \"GET /packages/35/d4/750403a8aa32cdb3d2d05849c6a10e4e0604de5e0cc94b81a0d0d69a75f3/torch_scatter-1.3.1.tar.gz HTTP/1.1\" 200 12787\n",
            "  Downloading https://files.pythonhosted.org/packages/35/d4/750403a8aa32cdb3d2d05849c6a10e4e0604de5e0cc94b81a0d0d69a75f3/torch_scatter-1.3.1.tar.gz\n",
            "  Downloading from URL https://files.pythonhosted.org/packages/35/d4/750403a8aa32cdb3d2d05849c6a10e4e0604de5e0cc94b81a0d0d69a75f3/torch_scatter-1.3.1.tar.gz#sha256=54cbad248350165ddc921ded3fe7a69be5d30c6536273a1a3282e375289f86ec (from https://pypi.org/simple/torch-scatter/)\n",
            "  Added torch-scatter from https://files.pythonhosted.org/packages/35/d4/750403a8aa32cdb3d2d05849c6a10e4e0604de5e0cc94b81a0d0d69a75f3/torch_scatter-1.3.1.tar.gz#sha256=54cbad248350165ddc921ded3fe7a69be5d30c6536273a1a3282e375289f86ec to build tracker '/tmp/pip-req-tracker-4_c_6b_n'\n",
            "    Running setup.py (path:/tmp/pip-install-5uyziksa/torch-scatter/setup.py) egg_info for package torch-scatter\n",
            "    Running command python setup.py egg_info\n",
            "    running egg_info\n",
            "    creating pip-egg-info/torch_scatter.egg-info\n",
            "    writing pip-egg-info/torch_scatter.egg-info/PKG-INFO\n",
            "    writing dependency_links to pip-egg-info/torch_scatter.egg-info/dependency_links.txt\n",
            "    writing top-level names to pip-egg-info/torch_scatter.egg-info/top_level.txt\n",
            "    writing manifest file 'pip-egg-info/torch_scatter.egg-info/SOURCES.txt'\n",
            "    reading manifest file 'pip-egg-info/torch_scatter.egg-info/SOURCES.txt'\n",
            "    reading manifest template 'MANIFEST.in'\n",
            "    writing manifest file 'pip-egg-info/torch_scatter.egg-info/SOURCES.txt'\n",
            "  Source in /tmp/pip-install-5uyziksa/torch-scatter has version 1.3.1, which satisfies requirement torch-scatter from https://files.pythonhosted.org/packages/35/d4/750403a8aa32cdb3d2d05849c6a10e4e0604de5e0cc94b81a0d0d69a75f3/torch_scatter-1.3.1.tar.gz#sha256=54cbad248350165ddc921ded3fe7a69be5d30c6536273a1a3282e375289f86ec\n",
            "  Removed torch-scatter from https://files.pythonhosted.org/packages/35/d4/750403a8aa32cdb3d2d05849c6a10e4e0604de5e0cc94b81a0d0d69a75f3/torch_scatter-1.3.1.tar.gz#sha256=54cbad248350165ddc921ded3fe7a69be5d30c6536273a1a3282e375289f86ec from build tracker '/tmp/pip-req-tracker-4_c_6b_n'\n",
            "Building wheels for collected packages: torch-scatter\n",
            "  Created temporary directory: /tmp/pip-wheel-q57q2lh0\n",
            "  Building wheel for torch-scatter (setup.py) ... \u001b[?25l  Destination directory: /tmp/pip-wheel-q57q2lh0\n",
            "  Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-5uyziksa/torch-scatter/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-5uyziksa/torch-scatter/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' bdist_wheel -d /tmp/pip-wheel-q57q2lh0 --python-tag cp36\n",
            "  running bdist_wheel\n",
            "  running build\n",
            "  running build_py\n",
            "  creating build\n",
            "  creating build/lib.linux-x86_64-3.6\n",
            "  creating build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/min.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/add.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/mul.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/sub.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/std.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/__init__.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/max.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/mean.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  copying torch_scatter/div.py -> build/lib.linux-x86_64-3.6/torch_scatter\n",
            "  creating build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_forward.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/utils.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_multi_gpu.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_backward.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/__init__.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_max_min.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_std.py -> build/lib.linux-x86_64-3.6/test\n",
            "  creating build/lib.linux-x86_64-3.6/torch_scatter/utils\n",
            "  copying torch_scatter/utils/gen.py -> build/lib.linux-x86_64-3.6/torch_scatter/utils\n",
            "  copying torch_scatter/utils/ext.py -> build/lib.linux-x86_64-3.6/torch_scatter/utils\n",
            "  copying torch_scatter/utils/__init__.py -> build/lib.linux-x86_64-3.6/torch_scatter/utils\n",
            "  running build_ext\n",
            "  building 'torch_scatter.scatter_cpu' extension\n",
            "  creating build/temp.linux-x86_64-3.6\n",
            "  creating build/temp.linux-x86_64-3.6/cpu\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/scatter.cpp -o build/temp.linux-x86_64-3.6/cpu/scatter.o -Wno-unused-variable -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/scatter.o -o build/lib.linux-x86_64-3.6/torch_scatter/scatter_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_scatter.scatter_cuda' extension\n",
            "  creating build/temp.linux-x86_64-3.6/cuda\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/scatter.cpp -o build/temp.linux-x86_64-3.6/cuda/scatter.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/scatter_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/scatter_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/scatter.o build/temp.linux-x86_64-3.6/cuda/scatter_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_scatter/scatter_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  installing to build/bdist.linux-x86_64/wheel\n",
            "  running install\n",
            "  running install_lib\n",
            "  creating build/bdist.linux-x86_64\n",
            "  creating build/bdist.linux-x86_64/wheel\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/min.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/add.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_scatter/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/utils/gen.py -> build/bdist.linux-x86_64/wheel/torch_scatter/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/utils/ext.py -> build/bdist.linux-x86_64/wheel/torch_scatter/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/utils/__init__.py -> build/bdist.linux-x86_64/wheel/torch_scatter/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/mul.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/scatter_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/sub.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/std.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/scatter_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/__init__.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/max.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/mean.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  copying build/lib.linux-x86_64-3.6/torch_scatter/div.py -> build/bdist.linux-x86_64/wheel/torch_scatter\n",
            "  creating build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_forward.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/utils.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_multi_gpu.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_backward.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/__init__.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_max_min.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_std.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  running install_egg_info\n",
            "  running egg_info\n",
            "  writing torch_scatter.egg-info/PKG-INFO\n",
            "  writing dependency_links to torch_scatter.egg-info/dependency_links.txt\n",
            "  writing top-level names to torch_scatter.egg-info/top_level.txt\n",
            "  reading manifest file 'torch_scatter.egg-info/SOURCES.txt'\n",
            "  reading manifest template 'MANIFEST.in'\n",
            "  writing manifest file 'torch_scatter.egg-info/SOURCES.txt'\n",
            "  Copying torch_scatter.egg-info to build/bdist.linux-x86_64/wheel/torch_scatter-1.3.1-py3.6.egg-info\n",
            "  running install_scripts\n",
            "  adding license file \"LICENSE\" (matched pattern \"LICEN[CS]E*\")\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_scatter-1.3.1.dist-info/WHEEL\n",
            "  creating '/tmp/pip-wheel-q57q2lh0/torch_scatter-1.3.1-cp36-cp36m-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it\n",
            "  adding 'test/__init__.py'\n",
            "  adding 'test/test_backward.py'\n",
            "  adding 'test/test_forward.py'\n",
            "  adding 'test/test_max_min.py'\n",
            "  adding 'test/test_multi_gpu.py'\n",
            "  adding 'test/test_std.py'\n",
            "  adding 'test/utils.py'\n",
            "  adding 'torch_scatter/__init__.py'\n",
            "  adding 'torch_scatter/add.py'\n",
            "  adding 'torch_scatter/div.py'\n",
            "  adding 'torch_scatter/max.py'\n",
            "  adding 'torch_scatter/mean.py'\n",
            "  adding 'torch_scatter/min.py'\n",
            "  adding 'torch_scatter/mul.py'\n",
            "  adding 'torch_scatter/scatter_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_scatter/scatter_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_scatter/std.py'\n",
            "  adding 'torch_scatter/sub.py'\n",
            "  adding 'torch_scatter/utils/__init__.py'\n",
            "  adding 'torch_scatter/utils/ext.py'\n",
            "  adding 'torch_scatter/utils/gen.py'\n",
            "  adding 'torch_scatter-1.3.1.dist-info/LICENSE'\n",
            "  adding 'torch_scatter-1.3.1.dist-info/METADATA'\n",
            "  adding 'torch_scatter-1.3.1.dist-info/WHEEL'\n",
            "  adding 'torch_scatter-1.3.1.dist-info/top_level.txt'\n",
            "  adding 'torch_scatter-1.3.1.dist-info/RECORD'\n",
            "  removing build/bdist.linux-x86_64/wheel\n",
            "\u001b[?25hdone\n",
            "  Created wheel for torch-scatter: filename=torch_scatter-1.3.1-cp36-cp36m-linux_x86_64.whl size=2860697 sha256=89a690b14900e06a3a24c1bbc3236880032e203330c1a956a6799689fbdcbe27\n",
            "  Stored in directory: /tmp/pip-ephem-wheel-cache-8ww75t66/wheels/7f/21/0b/c42fa9353ceec5e87464599e470a03e4250ec667b4a392fa7d\n",
            "  Removing source in /tmp/pip-install-5uyziksa/torch-scatter\n",
            "Successfully built torch-scatter\n",
            "Installing collected packages: torch-scatter\n",
            "\n",
            "Successfully installed torch-scatter-1.3.1\n",
            "Cleaning up...\n",
            "Removed build tracker '/tmp/pip-req-tracker-4_c_6b_n'\n",
            "Created temporary directory: /tmp/pip-ephem-wheel-cache-ctim3yjd\n",
            "Created temporary directory: /tmp/pip-req-tracker-mexsqcdl\n",
            "Created requirements tracker '/tmp/pip-req-tracker-mexsqcdl'\n",
            "Created temporary directory: /tmp/pip-install-1o_kfnyq\n",
            "Collecting torch-sparse\n",
            "  1 location(s) to search for versions of torch-sparse:\n",
            "  * https://pypi.org/simple/torch-sparse/\n",
            "  Getting page https://pypi.org/simple/torch-sparse/\n",
            "  Found index url https://pypi.org/simple\n",
            "  Starting new HTTPS connection (1): pypi.org:443\n",
            "  https://pypi.org:443 \"GET /simple/torch-sparse/ HTTP/1.1\" 200 835\n",
            "  Analyzing links from page https://pypi.org/simple/torch-sparse/\n",
            "    Found link https://files.pythonhosted.org/packages/21/a6/af5865f7bc2dc45ea789ebb35bdf5d84c05e140d7d2ec7e5823d24db176f/torch_sparse-0.1.0.tar.gz#sha256=d774c4b05a96bf09e3c3becd2f48c65ed66b03195a2cfc4992ef57c9a8c6b399 (from https://pypi.org/simple/torch-sparse/), version: 0.1.0\n",
            "    Found link https://files.pythonhosted.org/packages/02/4f/89bcb156022a3960c4db852915c64ea78b4e993e0f8d7a83e60e6819fc11/torch_sparse-0.2.0.tar.gz#sha256=578fdc3522b06c948d43fbc360d0dcde8a89d9a2496ac468592bf3493baedd33 (from https://pypi.org/simple/torch-sparse/), version: 0.2.0\n",
            "    Found link https://files.pythonhosted.org/packages/8f/41/98db80cc9d9345c76445393661ce4dd3e08fc46fb17028e7706612063e4d/torch_sparse-0.2.1.tar.gz#sha256=01346234f0e76103304f8aa1099f22c0904d2fff8b36c5ec0230335149f526bc (from https://pypi.org/simple/torch-sparse/), version: 0.2.1\n",
            "    Found link https://files.pythonhosted.org/packages/73/5b/5b7b6c66148afaa5e2ed8a3e18e109361957d28e67032d92cb282d173f32/torch_sparse-0.2.2.tar.gz#sha256=11e87c0214a4491168f15726ddda6c771b5f34be728f3edbb4add203e46d924d (from https://pypi.org/simple/torch-sparse/), version: 0.2.2\n",
            "    Found link https://files.pythonhosted.org/packages/43/2a/bb2ead5b33c6932937c6c74199ebecd72bd4b3ab224842a50366e5b2af4a/torch_sparse-0.2.3.tar.gz#sha256=47b3f85b0c243d0c98798db722b0f066830f6b8ff9d298a6e2aed0662598e356 (from https://pypi.org/simple/torch-sparse/), version: 0.2.3\n",
            "    Found link https://files.pythonhosted.org/packages/73/72/e374662f6f47d9ac0e082a6d5c18d14e15c52863e89c6bc6957a0d2ed026/torch_sparse-0.2.4.tar.gz#sha256=5cae8b40a5d11b8917e0f4b95034b5842b052f42a089ce59f8c02f2cff00ca55 (from https://pypi.org/simple/torch-sparse/), version: 0.2.4\n",
            "    Found link https://files.pythonhosted.org/packages/b0/0a/2ff678e0d04e524dd2cf990a6202ced8c0ffe3fe6b08e02f25cc9fd27da0/torch_sparse-0.4.0.tar.gz#sha256=bf217539b4f714a1d6fac4d39ace3ad8033871717f44f8f365a2746056b9d805 (from https://pypi.org/simple/torch-sparse/), version: 0.4.0\n",
            "  Given no hashes to check 7 links for project 'torch-sparse': discarding no candidates\n",
            "  Using version 0.4.0 (newest of versions: 0.1.0, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.4.0)\n",
            "  Created temporary directory: /tmp/pip-unpack-25yc6xwq\n",
            "  Starting new HTTPS connection (1): files.pythonhosted.org:443\n",
            "  https://files.pythonhosted.org:443 \"GET /packages/b0/0a/2ff678e0d04e524dd2cf990a6202ced8c0ffe3fe6b08e02f25cc9fd27da0/torch_sparse-0.4.0.tar.gz HTTP/1.1\" 200 10444\n",
            "  Downloading https://files.pythonhosted.org/packages/b0/0a/2ff678e0d04e524dd2cf990a6202ced8c0ffe3fe6b08e02f25cc9fd27da0/torch_sparse-0.4.0.tar.gz\n",
            "  Downloading from URL https://files.pythonhosted.org/packages/b0/0a/2ff678e0d04e524dd2cf990a6202ced8c0ffe3fe6b08e02f25cc9fd27da0/torch_sparse-0.4.0.tar.gz#sha256=bf217539b4f714a1d6fac4d39ace3ad8033871717f44f8f365a2746056b9d805 (from https://pypi.org/simple/torch-sparse/)\n",
            "  Added torch-sparse from https://files.pythonhosted.org/packages/b0/0a/2ff678e0d04e524dd2cf990a6202ced8c0ffe3fe6b08e02f25cc9fd27da0/torch_sparse-0.4.0.tar.gz#sha256=bf217539b4f714a1d6fac4d39ace3ad8033871717f44f8f365a2746056b9d805 to build tracker '/tmp/pip-req-tracker-mexsqcdl'\n",
            "    Running setup.py (path:/tmp/pip-install-1o_kfnyq/torch-sparse/setup.py) egg_info for package torch-sparse\n",
            "    Running command python setup.py egg_info\n",
            "    running egg_info\n",
            "    creating pip-egg-info/torch_sparse.egg-info\n",
            "    writing pip-egg-info/torch_sparse.egg-info/PKG-INFO\n",
            "    writing dependency_links to pip-egg-info/torch_sparse.egg-info/dependency_links.txt\n",
            "    writing requirements to pip-egg-info/torch_sparse.egg-info/requires.txt\n",
            "    writing top-level names to pip-egg-info/torch_sparse.egg-info/top_level.txt\n",
            "    writing manifest file 'pip-egg-info/torch_sparse.egg-info/SOURCES.txt'\n",
            "    reading manifest file 'pip-egg-info/torch_sparse.egg-info/SOURCES.txt'\n",
            "    reading manifest template 'MANIFEST.in'\n",
            "    writing manifest file 'pip-egg-info/torch_sparse.egg-info/SOURCES.txt'\n",
            "  Source in /tmp/pip-install-1o_kfnyq/torch-sparse has version 0.4.0, which satisfies requirement torch-sparse from https://files.pythonhosted.org/packages/b0/0a/2ff678e0d04e524dd2cf990a6202ced8c0ffe3fe6b08e02f25cc9fd27da0/torch_sparse-0.4.0.tar.gz#sha256=bf217539b4f714a1d6fac4d39ace3ad8033871717f44f8f365a2746056b9d805\n",
            "  Removed torch-sparse from https://files.pythonhosted.org/packages/b0/0a/2ff678e0d04e524dd2cf990a6202ced8c0ffe3fe6b08e02f25cc9fd27da0/torch_sparse-0.4.0.tar.gz#sha256=bf217539b4f714a1d6fac4d39ace3ad8033871717f44f8f365a2746056b9d805 from build tracker '/tmp/pip-req-tracker-mexsqcdl'\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from torch-sparse) (1.3.0)\n",
            "Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from scipy->torch-sparse) (1.16.4)\n",
            "Building wheels for collected packages: torch-sparse\n",
            "  Created temporary directory: /tmp/pip-wheel-yzuwqszk\n",
            "  Building wheel for torch-sparse (setup.py) ... \u001b[?25l  Destination directory: /tmp/pip-wheel-yzuwqszk\n",
            "  Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-1o_kfnyq/torch-sparse/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-1o_kfnyq/torch-sparse/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' bdist_wheel -d /tmp/pip-wheel-yzuwqszk --python-tag cp36\n",
            "  running bdist_wheel\n",
            "  running build\n",
            "  running build_py\n",
            "  creating build\n",
            "  creating build/lib.linux-x86_64-3.6\n",
            "  creating build/lib.linux-x86_64-3.6/test\n",
            "  copying test/utils.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_transpose.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_spspmm.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_convert.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/__init__.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_coalesce.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_spspmm_spmm.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_eye.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_spmm.py -> build/lib.linux-x86_64-3.6/test\n",
            "  creating build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  copying torch_sparse/convert.py -> build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  copying torch_sparse/coalesce.py -> build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  copying torch_sparse/transpose.py -> build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  copying torch_sparse/eye.py -> build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  copying torch_sparse/spspmm.py -> build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  copying torch_sparse/spmm.py -> build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  copying torch_sparse/__init__.py -> build/lib.linux-x86_64-3.6/torch_sparse\n",
            "  creating build/lib.linux-x86_64-3.6/torch_sparse/utils\n",
            "  copying torch_sparse/utils/unique.py -> build/lib.linux-x86_64-3.6/torch_sparse/utils\n",
            "  copying torch_sparse/utils/__init__.py -> build/lib.linux-x86_64-3.6/torch_sparse/utils\n",
            "  running build_ext\n",
            "  building 'torch_sparse.spspmm_cpu' extension\n",
            "  creating build/temp.linux-x86_64-3.6\n",
            "  creating build/temp.linux-x86_64-3.6/cpu\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/spspmm.cpp -o build/temp.linux-x86_64-3.6/cpu/spspmm.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spspmm_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/spspmm.o -o build/lib.linux-x86_64-3.6/torch_sparse/spspmm_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_sparse.spspmm_cuda' extension\n",
            "  creating build/temp.linux-x86_64-3.6/cuda\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/spspmm.cpp -o build/temp.linux-x86_64-3.6/cuda/spspmm.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spspmm_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/spspmm_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/spspmm_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spspmm_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/spspmm.o build/temp.linux-x86_64-3.6/cuda/spspmm_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_sparse/spspmm_cuda.cpython-36m-x86_64-linux-gnu.so -lcusparse -l cusparse\n",
            "  building 'torch_sparse.unique_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/unique.cpp -o build/temp.linux-x86_64-3.6/cuda/unique.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=unique_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/unique_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/unique_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=unique_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/unique.o build/temp.linux-x86_64-3.6/cuda/unique_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_sparse/unique_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  installing to build/bdist.linux-x86_64/wheel\n",
            "  running install\n",
            "  running install_lib\n",
            "  creating build/bdist.linux-x86_64\n",
            "  creating build/bdist.linux-x86_64/wheel\n",
            "  creating build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/utils.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_transpose.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_spspmm.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_convert.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/__init__.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_coalesce.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_spspmm_spmm.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_eye.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_spmm.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/convert.py -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/coalesce.py -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_sparse/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/utils/unique.py -> build/bdist.linux-x86_64/wheel/torch_sparse/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/utils/__init__.py -> build/bdist.linux-x86_64/wheel/torch_sparse/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/transpose.py -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/eye.py -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/spspmm.py -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/spmm.py -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/__init__.py -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/spspmm_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/unique_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  copying build/lib.linux-x86_64-3.6/torch_sparse/spspmm_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_sparse\n",
            "  running install_egg_info\n",
            "  running egg_info\n",
            "  writing torch_sparse.egg-info/PKG-INFO\n",
            "  writing dependency_links to torch_sparse.egg-info/dependency_links.txt\n",
            "  writing requirements to torch_sparse.egg-info/requires.txt\n",
            "  writing top-level names to torch_sparse.egg-info/top_level.txt\n",
            "  reading manifest file 'torch_sparse.egg-info/SOURCES.txt'\n",
            "  reading manifest template 'MANIFEST.in'\n",
            "  writing manifest file 'torch_sparse.egg-info/SOURCES.txt'\n",
            "  Copying torch_sparse.egg-info to build/bdist.linux-x86_64/wheel/torch_sparse-0.4.0-py3.6.egg-info\n",
            "  running install_scripts\n",
            "  adding license file \"LICENSE\" (matched pattern \"LICEN[CS]E*\")\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_sparse-0.4.0.dist-info/WHEEL\n",
            "  creating '/tmp/pip-wheel-yzuwqszk/torch_sparse-0.4.0-cp36-cp36m-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it\n",
            "  adding 'test/__init__.py'\n",
            "  adding 'test/test_coalesce.py'\n",
            "  adding 'test/test_convert.py'\n",
            "  adding 'test/test_eye.py'\n",
            "  adding 'test/test_spmm.py'\n",
            "  adding 'test/test_spspmm.py'\n",
            "  adding 'test/test_spspmm_spmm.py'\n",
            "  adding 'test/test_transpose.py'\n",
            "  adding 'test/utils.py'\n",
            "  adding 'torch_sparse/__init__.py'\n",
            "  adding 'torch_sparse/coalesce.py'\n",
            "  adding 'torch_sparse/convert.py'\n",
            "  adding 'torch_sparse/eye.py'\n",
            "  adding 'torch_sparse/spmm.py'\n",
            "  adding 'torch_sparse/spspmm.py'\n",
            "  adding 'torch_sparse/spspmm_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_sparse/spspmm_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_sparse/transpose.py'\n",
            "  adding 'torch_sparse/unique_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_sparse/utils/__init__.py'\n",
            "  adding 'torch_sparse/utils/unique.py'\n",
            "  adding 'torch_sparse-0.4.0.dist-info/LICENSE'\n",
            "  adding 'torch_sparse-0.4.0.dist-info/METADATA'\n",
            "  adding 'torch_sparse-0.4.0.dist-info/WHEEL'\n",
            "  adding 'torch_sparse-0.4.0.dist-info/top_level.txt'\n",
            "  adding 'torch_sparse-0.4.0.dist-info/RECORD'\n",
            "  removing build/bdist.linux-x86_64/wheel\n",
            "\u001b[?25hdone\n",
            "  Created wheel for torch-sparse: filename=torch_sparse-0.4.0-cp36-cp36m-linux_x86_64.whl size=3831878 sha256=6b24a538c0658fd47b674a1d025f450eaf90ba5135e833aa03a9e6ae32b3f55b\n",
            "  Stored in directory: /tmp/pip-ephem-wheel-cache-ctim3yjd/wheels/9d/83/0a/38ea460df5586a075b877fe089619e5238487712a0645940bd\n",
            "  Removing source in /tmp/pip-install-1o_kfnyq/torch-sparse\n",
            "Successfully built torch-sparse\n",
            "Installing collected packages: torch-sparse\n",
            "\n",
            "Successfully installed torch-sparse-0.4.0\n",
            "Cleaning up...\n",
            "Removed build tracker '/tmp/pip-req-tracker-mexsqcdl'\n",
            "Created temporary directory: /tmp/pip-ephem-wheel-cache-633emo77\n",
            "Created temporary directory: /tmp/pip-req-tracker-ruuwizbu\n",
            "Created requirements tracker '/tmp/pip-req-tracker-ruuwizbu'\n",
            "Created temporary directory: /tmp/pip-install-pgze958_\n",
            "Collecting torch-cluster\n",
            "  1 location(s) to search for versions of torch-cluster:\n",
            "  * https://pypi.org/simple/torch-cluster/\n",
            "  Getting page https://pypi.org/simple/torch-cluster/\n",
            "  Found index url https://pypi.org/simple\n",
            "  Starting new HTTPS connection (1): pypi.org:443\n",
            "  https://pypi.org:443 \"GET /simple/torch-cluster/ HTTP/1.1\" 200 1999\n",
            "  Analyzing links from page https://pypi.org/simple/torch-cluster/\n",
            "    Found link https://files.pythonhosted.org/packages/58/77/1ddc3390129653d1e0e1e0c8063d47a2f40abc888d95b4a2fba774e215df/torch_cluster-0.1.1.tar.gz#sha256=f4f64eabc4c380bff9863d3ce9b93b0a65c7ea6f797f9ee053dc74d7d92ea928 (from https://pypi.org/simple/torch-cluster/), version: 0.1.1\n",
            "    Found link https://files.pythonhosted.org/packages/ac/92/c583aabacb052afed67db146662c23625ad861a74140e338996816a879f4/torch_cluster-0.2.3.tar.gz#sha256=43d9840078f962abfced55043d8320f80c7f91aa7f54398b9ad631ee577bbfb1 (from https://pypi.org/simple/torch-cluster/), version: 0.2.3\n",
            "    Found link https://files.pythonhosted.org/packages/6e/9b/493def262b256290ad6913c9f36b774af6f52d9d46d3fee31b77b3803eb0/torch_cluster-0.2.4.tar.gz#sha256=f421986d71a644b72c69551f09df31eb8657203d59d639aac33192192ed675b5 (from https://pypi.org/simple/torch-cluster/), version: 0.2.4\n",
            "    Found link https://files.pythonhosted.org/packages/8a/2c/ddf6e6fc9c4af6c37a20996100cf6a6427accd7939470bc99071d3487753/torch_cluster-1.0.1.tar.gz#sha256=04cf3ad486eff6cc6069e3d1c18a2acd7662169f36d02a13f3a7adaabfc06b91 (from https://pypi.org/simple/torch-cluster/), version: 1.0.1\n",
            "    Found link https://files.pythonhosted.org/packages/87/9d/e488a5186684632e3e0f14eaec125936cf25a3a24552afd26e7bb426d2ee/torch_cluster-1.0.3.tar.gz#sha256=795264f9e9f36eb44aeb28716d68ea93cd6dc7f75c8e05e0d16eb0597ffcd1a6 (from https://pypi.org/simple/torch-cluster/), version: 1.0.3\n",
            "    Found link https://files.pythonhosted.org/packages/7b/95/bca3179ce501792bf268d37f18cc82577c289fa093bfdcfc26e375019da5/torch_cluster-1.1.1.tar.gz#sha256=e919f64153fd97efe958a509a0a558a31bf5f2dbe2deeff09d300e33d3994b14 (from https://pypi.org/simple/torch-cluster/), version: 1.1.1\n",
            "    Found link https://files.pythonhosted.org/packages/36/b0/25ca8b811059e001f1e3285ac3036b6969fb21350e411c6881ba2b9be3c3/torch_cluster-1.1.2.tar.gz#sha256=082c4e71079cd1bed89da4178b3391361fa6aac5ae2edb783c08fed3da5b93c4 (from https://pypi.org/simple/torch-cluster/), version: 1.1.2\n",
            "    Found link https://files.pythonhosted.org/packages/e2/4f/5205f832d3eef871fe71564aa9fb8504a65be5e95be09800e125e224e634/torch_cluster-1.1.3.tar.gz#sha256=d5c80159f91e329bcc95b316a29ecf466257598680b3b5fb2ea137a585037c78 (from https://pypi.org/simple/torch-cluster/), version: 1.1.3\n",
            "    Found link https://files.pythonhosted.org/packages/d0/e1/495ecc73f1e5534ecbedf1a301557d6c9fc93417467e5107fd9ac54fcbfa/torch_cluster-1.1.4.tar.gz#sha256=a298694afe91f146be3921b8c9da06051958b7598c6e69a9af5833a1af56e7f3 (from https://pypi.org/simple/torch-cluster/), version: 1.1.4\n",
            "    Found link https://files.pythonhosted.org/packages/a6/b3/de9c051d1df504d78542d178231f2ae7d08a411c9ca59219028742886947/torch_cluster-1.1.5.tar.gz#sha256=b67d6c89b71e4146dcfa078cc6a201a1647d888441a9f278b30770f91c7978a1 (from https://pypi.org/simple/torch-cluster/), version: 1.1.5\n",
            "    Found link https://files.pythonhosted.org/packages/96/de/9506fa869cf52edc58c2517b41c0ec1c7678c05b95aff000a509e4238765/torch_cluster-1.2.1.tar.gz#sha256=371b438113bcb7cab1b6931740e9194972f0f7349e1d033437a4196d7d693130 (from https://pypi.org/simple/torch-cluster/), version: 1.2.1\n",
            "    Found link https://files.pythonhosted.org/packages/33/b7/05b9ce9afc76f5709efe04d6344fbed09ea217f916f94e63f2fe9659eb62/torch_cluster-1.2.2.tar.gz#sha256=a1e39e16a7ade806a852117fe16fe2b505fd4bc43bc4207f48fecb0f6b2e1f64 (from https://pypi.org/simple/torch-cluster/), version: 1.2.2\n",
            "    Found link https://files.pythonhosted.org/packages/67/19/a0b1e3a7633ced39d9977ce0b98a1b3e343f0772f4090b0a2d421ac5b56d/torch_cluster-1.2.3.tar.gz#sha256=f8a6b5f47bf6a2a396301d0f4ec0733a650f7a5ae84b08b8625408b8979747ea (from https://pypi.org/simple/torch-cluster/), version: 1.2.3\n",
            "    Found link https://files.pythonhosted.org/packages/32/c8/9b3af10be647326dd807bb2fe7ced8ae4c3fd74178dba884621749afc4d7/torch_cluster-1.2.4.tar.gz#sha256=4e5f8c15b28329b269adecadd64917cb5373c6438a5fdf463f633bd4e73c4ae6 (from https://pypi.org/simple/torch-cluster/), version: 1.2.4\n",
            "    Found link https://files.pythonhosted.org/packages/93/f9/89319a7344e5bcda090fb3996c4271b1fda238ad90401a315c9af1ce4137/torch_cluster-1.3.0.tar.gz#sha256=7b0e1b7061bf8c2754d63a66159f47757ce28b072bc37921fbcc59974eb2d342 (from https://pypi.org/simple/torch-cluster/), version: 1.3.0\n",
            "    Found link https://files.pythonhosted.org/packages/6b/3b/a34740494a1b25cb2ef4ed09e5d5ef6bc75be884f6b25bd93a7acdf03134/torch_cluster-1.4.0.tar.gz#sha256=c256d61f20193b104a2f4c610b4ad95fa3cbaeb72b2ae9bf3d254cb3d573e945 (from https://pypi.org/simple/torch-cluster/), version: 1.4.0\n",
            "    Found link https://files.pythonhosted.org/packages/2f/0c/77453228c248e8071d185940ecb3dd9eca3cac180767bde75b2bc05c0c65/torch_cluster-1.4.1.tar.gz#sha256=e7a900d54cb2dc241c84b1da382f358399880c61290f7be72babf98500496494 (from https://pypi.org/simple/torch-cluster/), version: 1.4.1\n",
            "    Found link https://files.pythonhosted.org/packages/33/38/60ad2fcb735123429b3e0b165a19c80c6273d679b01d6550782abcb314e2/torch_cluster-1.4.2.tar.gz#sha256=ed437ec01f431d0f36398cc321524aac27870cc09e7a5a869726af9c15ac354a (from https://pypi.org/simple/torch-cluster/), version: 1.4.2\n",
            "    Found link https://files.pythonhosted.org/packages/7e/30/b315f136648801433ce6b2724fe3bfaae3c0f8a13282aa58d38ad2a8a3db/torch_cluster-1.4.3a1.tar.gz#sha256=680e47ee41a0cec223c179ce3ea2174de48ac6a277eced453ccadf4bdd2f51c9 (from https://pypi.org/simple/torch-cluster/), version: 1.4.3a1\n",
            "    Found link https://files.pythonhosted.org/packages/49/0d/f7151fb6aad5c9b0e032e46c0678e0404870de4add35b0723fc2a5c4af35/torch_cluster-1.4.3.tar.gz#sha256=340eaf9e31a7a0618f2c3d61c480e1d74466c930827f10fee86d11d8c5b85cba (from https://pypi.org/simple/torch-cluster/), version: 1.4.3\n",
            "  Given no hashes to check 19 links for project 'torch-cluster': discarding no candidates\n",
            "  Using version 1.4.3 (newest of versions: 0.1.1, 0.2.3, 0.2.4, 1.0.1, 1.0.3, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.4.3)\n",
            "  Created temporary directory: /tmp/pip-unpack-l_xu04dg\n",
            "  Starting new HTTPS connection (1): files.pythonhosted.org:443\n",
            "  https://files.pythonhosted.org:443 \"GET /packages/49/0d/f7151fb6aad5c9b0e032e46c0678e0404870de4add35b0723fc2a5c4af35/torch_cluster-1.4.3.tar.gz HTTP/1.1\" 200 18480\n",
            "  Downloading https://files.pythonhosted.org/packages/49/0d/f7151fb6aad5c9b0e032e46c0678e0404870de4add35b0723fc2a5c4af35/torch_cluster-1.4.3.tar.gz\n",
            "  Downloading from URL https://files.pythonhosted.org/packages/49/0d/f7151fb6aad5c9b0e032e46c0678e0404870de4add35b0723fc2a5c4af35/torch_cluster-1.4.3.tar.gz#sha256=340eaf9e31a7a0618f2c3d61c480e1d74466c930827f10fee86d11d8c5b85cba (from https://pypi.org/simple/torch-cluster/)\n",
            "  Added torch-cluster from https://files.pythonhosted.org/packages/49/0d/f7151fb6aad5c9b0e032e46c0678e0404870de4add35b0723fc2a5c4af35/torch_cluster-1.4.3.tar.gz#sha256=340eaf9e31a7a0618f2c3d61c480e1d74466c930827f10fee86d11d8c5b85cba to build tracker '/tmp/pip-req-tracker-ruuwizbu'\n",
            "    Running setup.py (path:/tmp/pip-install-pgze958_/torch-cluster/setup.py) egg_info for package torch-cluster\n",
            "    Running command python setup.py egg_info\n",
            "    running egg_info\n",
            "    creating pip-egg-info/torch_cluster.egg-info\n",
            "    writing pip-egg-info/torch_cluster.egg-info/PKG-INFO\n",
            "    writing dependency_links to pip-egg-info/torch_cluster.egg-info/dependency_links.txt\n",
            "    writing requirements to pip-egg-info/torch_cluster.egg-info/requires.txt\n",
            "    writing top-level names to pip-egg-info/torch_cluster.egg-info/top_level.txt\n",
            "    writing manifest file 'pip-egg-info/torch_cluster.egg-info/SOURCES.txt'\n",
            "    reading manifest file 'pip-egg-info/torch_cluster.egg-info/SOURCES.txt'\n",
            "    reading manifest template 'MANIFEST.in'\n",
            "    writing manifest file 'pip-egg-info/torch_cluster.egg-info/SOURCES.txt'\n",
            "  Source in /tmp/pip-install-pgze958_/torch-cluster has version 1.4.3, which satisfies requirement torch-cluster from https://files.pythonhosted.org/packages/49/0d/f7151fb6aad5c9b0e032e46c0678e0404870de4add35b0723fc2a5c4af35/torch_cluster-1.4.3.tar.gz#sha256=340eaf9e31a7a0618f2c3d61c480e1d74466c930827f10fee86d11d8c5b85cba\n",
            "  Removed torch-cluster from https://files.pythonhosted.org/packages/49/0d/f7151fb6aad5c9b0e032e46c0678e0404870de4add35b0723fc2a5c4af35/torch_cluster-1.4.3.tar.gz#sha256=340eaf9e31a7a0618f2c3d61c480e1d74466c930827f10fee86d11d8c5b85cba from build tracker '/tmp/pip-req-tracker-ruuwizbu'\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from torch-cluster) (1.3.0)\n",
            "Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from scipy->torch-cluster) (1.16.4)\n",
            "Building wheels for collected packages: torch-cluster\n",
            "  Created temporary directory: /tmp/pip-wheel-aablb3no\n",
            "  Building wheel for torch-cluster (setup.py) ... \u001b[?25l  Destination directory: /tmp/pip-wheel-aablb3no\n",
            "  Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-pgze958_/torch-cluster/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-pgze958_/torch-cluster/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' bdist_wheel -d /tmp/pip-wheel-aablb3no --python-tag cp36\n",
            "  running bdist_wheel\n",
            "  running build\n",
            "  running build_py\n",
            "  creating build\n",
            "  creating build/lib.linux-x86_64-3.6\n",
            "  creating build/lib.linux-x86_64-3.6/test\n",
            "  copying test/utils.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_graclus.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_knn.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_radius.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_sampler.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/__init__.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_nearest.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_fps.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_rw.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_grid.py -> build/lib.linux-x86_64-3.6/test\n",
            "  creating build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/nearest.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/sampler.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/grid.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/graclus.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/knn.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/__init__.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/radius.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/rw.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  copying torch_cluster/fps.py -> build/lib.linux-x86_64-3.6/torch_cluster\n",
            "  running build_ext\n",
            "  building 'torch_cluster.graclus_cpu' extension\n",
            "  creating build/temp.linux-x86_64-3.6\n",
            "  creating build/temp.linux-x86_64-3.6/cpu\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/graclus.cpp -o build/temp.linux-x86_64-3.6/cpu/graclus.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=graclus_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/graclus.o -o build/lib.linux-x86_64-3.6/torch_cluster/graclus_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.grid_cpu' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/grid.cpp -o build/temp.linux-x86_64-3.6/cpu/grid.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=grid_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/grid.o -o build/lib.linux-x86_64-3.6/torch_cluster/grid_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.fps_cpu' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/fps.cpp -o build/temp.linux-x86_64-3.6/cpu/fps.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=fps_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/fps.o -o build/lib.linux-x86_64-3.6/torch_cluster/fps_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.rw_cpu' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/rw.cpp -o build/temp.linux-x86_64-3.6/cpu/rw.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=rw_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/rw.o -o build/lib.linux-x86_64-3.6/torch_cluster/rw_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.sampler_cpu' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/sampler.cpp -o build/temp.linux-x86_64-3.6/cpu/sampler.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sampler_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/sampler.o -o build/lib.linux-x86_64-3.6/torch_cluster/sampler_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.graclus_cuda' extension\n",
            "  creating build/temp.linux-x86_64-3.6/cuda\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/graclus.cpp -o build/temp.linux-x86_64-3.6/cuda/graclus.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=graclus_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/graclus_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/graclus_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=graclus_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/graclus.o build/temp.linux-x86_64-3.6/cuda/graclus_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_cluster/graclus_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.grid_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/grid.cpp -o build/temp.linux-x86_64-3.6/cuda/grid.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=grid_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/grid_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/grid_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=grid_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/grid.o build/temp.linux-x86_64-3.6/cuda/grid_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_cluster/grid_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.fps_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/fps.cpp -o build/temp.linux-x86_64-3.6/cuda/fps.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=fps_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/fps_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/fps_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=fps_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/fps.o build/temp.linux-x86_64-3.6/cuda/fps_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_cluster/fps_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.nearest_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/nearest.cpp -o build/temp.linux-x86_64-3.6/cuda/nearest.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nearest_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/nearest_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/nearest_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nearest_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/nearest.o build/temp.linux-x86_64-3.6/cuda/nearest_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_cluster/nearest_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.knn_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/knn.cpp -o build/temp.linux-x86_64-3.6/cuda/knn.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=knn_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/knn_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/knn_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=knn_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/knn.o build/temp.linux-x86_64-3.6/cuda/knn_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_cluster/knn_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.radius_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/radius.cpp -o build/temp.linux-x86_64-3.6/cuda/radius.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=radius_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/radius_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/radius_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=radius_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/radius.o build/temp.linux-x86_64-3.6/cuda/radius_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_cluster/radius_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_cluster.rw_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/rw.cpp -o build/temp.linux-x86_64-3.6/cuda/rw.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=rw_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/rw_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/rw_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=rw_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/rw.o build/temp.linux-x86_64-3.6/cuda/rw_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_cluster/rw_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  installing to build/bdist.linux-x86_64/wheel\n",
            "  running install\n",
            "  running install_lib\n",
            "  creating build/bdist.linux-x86_64\n",
            "  creating build/bdist.linux-x86_64/wheel\n",
            "  creating build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/utils.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_graclus.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_knn.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_radius.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_sampler.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/__init__.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_nearest.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_fps.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_rw.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_grid.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/nearest.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/radius_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/grid_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/rw_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/rw_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/knn_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/sampler.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/sampler_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/graclus_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/grid.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/grid_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/graclus.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/knn.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/__init__.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/fps_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/radius.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/rw.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/fps_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/graclus_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/fps.py -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  copying build/lib.linux-x86_64-3.6/torch_cluster/nearest_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_cluster\n",
            "  running install_egg_info\n",
            "  running egg_info\n",
            "  writing torch_cluster.egg-info/PKG-INFO\n",
            "  writing dependency_links to torch_cluster.egg-info/dependency_links.txt\n",
            "  writing requirements to torch_cluster.egg-info/requires.txt\n",
            "  writing top-level names to torch_cluster.egg-info/top_level.txt\n",
            "  reading manifest file 'torch_cluster.egg-info/SOURCES.txt'\n",
            "  reading manifest template 'MANIFEST.in'\n",
            "  writing manifest file 'torch_cluster.egg-info/SOURCES.txt'\n",
            "  Copying torch_cluster.egg-info to build/bdist.linux-x86_64/wheel/torch_cluster-1.4.3-py3.6.egg-info\n",
            "  running install_scripts\n",
            "  adding license file \"LICENSE\" (matched pattern \"LICEN[CS]E*\")\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_cluster-1.4.3.dist-info/WHEEL\n",
            "  creating '/tmp/pip-wheel-aablb3no/torch_cluster-1.4.3-cp36-cp36m-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it\n",
            "  adding 'test/__init__.py'\n",
            "  adding 'test/test_fps.py'\n",
            "  adding 'test/test_graclus.py'\n",
            "  adding 'test/test_grid.py'\n",
            "  adding 'test/test_knn.py'\n",
            "  adding 'test/test_nearest.py'\n",
            "  adding 'test/test_radius.py'\n",
            "  adding 'test/test_rw.py'\n",
            "  adding 'test/test_sampler.py'\n",
            "  adding 'test/utils.py'\n",
            "  adding 'torch_cluster/__init__.py'\n",
            "  adding 'torch_cluster/fps.py'\n",
            "  adding 'torch_cluster/fps_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/fps_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/graclus.py'\n",
            "  adding 'torch_cluster/graclus_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/graclus_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/grid.py'\n",
            "  adding 'torch_cluster/grid_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/grid_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/knn.py'\n",
            "  adding 'torch_cluster/knn_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/nearest.py'\n",
            "  adding 'torch_cluster/nearest_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/radius.py'\n",
            "  adding 'torch_cluster/radius_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/rw.py'\n",
            "  adding 'torch_cluster/rw_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/rw_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster/sampler.py'\n",
            "  adding 'torch_cluster/sampler_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_cluster-1.4.3.dist-info/LICENSE'\n",
            "  adding 'torch_cluster-1.4.3.dist-info/METADATA'\n",
            "  adding 'torch_cluster-1.4.3.dist-info/WHEEL'\n",
            "  adding 'torch_cluster-1.4.3.dist-info/top_level.txt'\n",
            "  adding 'torch_cluster-1.4.3.dist-info/RECORD'\n",
            "  removing build/bdist.linux-x86_64/wheel\n",
            "\u001b[?25hdone\n",
            "  Created wheel for torch-cluster: filename=torch_cluster-1.4.3-cp36-cp36m-linux_x86_64.whl size=15480043 sha256=a2a3dff5209da392cbb1535124354016f2e5b926fa88f3399f929d7dcea046ac\n",
            "  Stored in directory: /tmp/pip-ephem-wheel-cache-633emo77/wheels/e5/43/44/f48fe189a54ce1177a6bdeb8eefc332d8cedf511dd35175a74\n",
            "  Removing source in /tmp/pip-install-pgze958_/torch-cluster\n",
            "Successfully built torch-cluster\n",
            "Installing collected packages: torch-cluster\n",
            "\n",
            "Successfully installed torch-cluster-1.4.3\n",
            "Cleaning up...\n",
            "Removed build tracker '/tmp/pip-req-tracker-ruuwizbu'\n",
            "Created temporary directory: /tmp/pip-ephem-wheel-cache-e749rsx1\n",
            "Created temporary directory: /tmp/pip-req-tracker-tlrzpmfb\n",
            "Created requirements tracker '/tmp/pip-req-tracker-tlrzpmfb'\n",
            "Created temporary directory: /tmp/pip-install-qhlle6k3\n",
            "Collecting torch-spline-conv\n",
            "  1 location(s) to search for versions of torch-spline-conv:\n",
            "  * https://pypi.org/simple/torch-spline-conv/\n",
            "  Getting page https://pypi.org/simple/torch-spline-conv/\n",
            "  Found index url https://pypi.org/simple\n",
            "  Starting new HTTPS connection (1): pypi.org:443\n",
            "  https://pypi.org:443 \"GET /simple/torch-spline-conv/ HTTP/1.1\" 200 936\n",
            "  Analyzing links from page https://pypi.org/simple/torch-spline-conv/\n",
            "    Found link https://files.pythonhosted.org/packages/43/48/02fd06eca47d38efc031b34875c2e7453faab7bde7c02b2669957d230693/torch_spline_conv-0.1.0.tar.gz#sha256=b1d7bceecffb4bc394d9f5df57b56fbff95867aeb778588a054e95a6ba5cd610 (from https://pypi.org/simple/torch-spline-conv/), version: 0.1.0\n",
            "    Found link https://files.pythonhosted.org/packages/99/a6/19a54aaaf507960814af5b6ec3d6916497d54a9345d0b64a98764465fddc/torch_spline_conv-1.0.0.tar.gz#sha256=72950ae9cc15dd00d0977ffca115af0e59c10f1dbac33dd800307fef2b5808c3 (from https://pypi.org/simple/torch-spline-conv/), version: 1.0.0\n",
            "    Found link https://files.pythonhosted.org/packages/4a/e9/973d572b69f8fef3b08d86f77312a75ab4c00ffe8d3582ae09b433b34b8a/torch_spline_conv-1.0.1.tar.gz#sha256=6be33fab8402950b2ddc1dec950d0b5d4c6f183bcf53bca2534a03eb4fd5801b (from https://pypi.org/simple/torch-spline-conv/), version: 1.0.1\n",
            "    Found link https://files.pythonhosted.org/packages/bc/ff/4e834a74fd180f87f6f9aedcfd876cca4c6fa706afa31e9541838f6958d1/torch_spline_conv-1.0.3.tar.gz#sha256=a0be3bc9847458ca92146c2da754dbd2f910be426414757256416e507240da88 (from https://pypi.org/simple/torch-spline-conv/), version: 1.0.3\n",
            "    Found link https://files.pythonhosted.org/packages/1b/d2/98328ef2395b70b9795ddbd091398e49e918f8892d1ea8dad869550b684b/torch_spline_conv-1.0.4.tar.gz#sha256=26e2bb0832d45d185f2e7b38569e64e7f70af8ca2a8b05663972f261ba76a978 (from https://pypi.org/simple/torch-spline-conv/), version: 1.0.4\n",
            "    Found link https://files.pythonhosted.org/packages/92/86/f086f96e09654106ad527f4b03ac6188c1299a9fe555fc39c663b155a05a/torch_spline_conv-1.0.5.tar.gz#sha256=fffa87c94703e4c43a46bd8ec149cd6c125586ebd1f3c04fec48d1f6b60a4f3c (from https://pypi.org/simple/torch-spline-conv/), version: 1.0.5\n",
            "    Found link https://files.pythonhosted.org/packages/9a/6d/b34721af4bb907814a41a1e0e5e426c97aee644efef6877ed112bfb3d81c/torch_spline_conv-1.0.6.tar.gz#sha256=a8bd72bac7dc078ddfbf22789c5fcdf159901494c626344d67ad203e7f8c9b1e (from https://pypi.org/simple/torch-spline-conv/), version: 1.0.6\n",
            "    Found link https://files.pythonhosted.org/packages/3c/dd/daa9d0b7b2ede913e573876ae286a58ec296678858f2814ff6d6789b234f/torch_spline_conv-1.1.0.tar.gz#sha256=e6029526205d1f7cb535389bebd81decf0649a20ea6a67688c02bd335a7f9339 (from https://pypi.org/simple/torch-spline-conv/), version: 1.1.0\n",
            "  Given no hashes to check 8 links for project 'torch-spline-conv': discarding no candidates\n",
            "  Using version 1.1.0 (newest of versions: 0.1.0, 1.0.0, 1.0.1, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.1.0)\n",
            "  Created temporary directory: /tmp/pip-unpack-2z8naquu\n",
            "  Starting new HTTPS connection (1): files.pythonhosted.org:443\n",
            "  https://files.pythonhosted.org:443 \"GET /packages/3c/dd/daa9d0b7b2ede913e573876ae286a58ec296678858f2814ff6d6789b234f/torch_spline_conv-1.1.0.tar.gz HTTP/1.1\" 200 12931\n",
            "  Downloading https://files.pythonhosted.org/packages/3c/dd/daa9d0b7b2ede913e573876ae286a58ec296678858f2814ff6d6789b234f/torch_spline_conv-1.1.0.tar.gz\n",
            "  Downloading from URL https://files.pythonhosted.org/packages/3c/dd/daa9d0b7b2ede913e573876ae286a58ec296678858f2814ff6d6789b234f/torch_spline_conv-1.1.0.tar.gz#sha256=e6029526205d1f7cb535389bebd81decf0649a20ea6a67688c02bd335a7f9339 (from https://pypi.org/simple/torch-spline-conv/)\n",
            "  Added torch-spline-conv from https://files.pythonhosted.org/packages/3c/dd/daa9d0b7b2ede913e573876ae286a58ec296678858f2814ff6d6789b234f/torch_spline_conv-1.1.0.tar.gz#sha256=e6029526205d1f7cb535389bebd81decf0649a20ea6a67688c02bd335a7f9339 to build tracker '/tmp/pip-req-tracker-tlrzpmfb'\n",
            "    Running setup.py (path:/tmp/pip-install-qhlle6k3/torch-spline-conv/setup.py) egg_info for package torch-spline-conv\n",
            "    Running command python setup.py egg_info\n",
            "    running egg_info\n",
            "    creating pip-egg-info/torch_spline_conv.egg-info\n",
            "    writing pip-egg-info/torch_spline_conv.egg-info/PKG-INFO\n",
            "    writing dependency_links to pip-egg-info/torch_spline_conv.egg-info/dependency_links.txt\n",
            "    writing top-level names to pip-egg-info/torch_spline_conv.egg-info/top_level.txt\n",
            "    writing manifest file 'pip-egg-info/torch_spline_conv.egg-info/SOURCES.txt'\n",
            "    reading manifest file 'pip-egg-info/torch_spline_conv.egg-info/SOURCES.txt'\n",
            "    reading manifest template 'MANIFEST.in'\n",
            "    writing manifest file 'pip-egg-info/torch_spline_conv.egg-info/SOURCES.txt'\n",
            "  Source in /tmp/pip-install-qhlle6k3/torch-spline-conv has version 1.1.0, which satisfies requirement torch-spline-conv from https://files.pythonhosted.org/packages/3c/dd/daa9d0b7b2ede913e573876ae286a58ec296678858f2814ff6d6789b234f/torch_spline_conv-1.1.0.tar.gz#sha256=e6029526205d1f7cb535389bebd81decf0649a20ea6a67688c02bd335a7f9339\n",
            "  Removed torch-spline-conv from https://files.pythonhosted.org/packages/3c/dd/daa9d0b7b2ede913e573876ae286a58ec296678858f2814ff6d6789b234f/torch_spline_conv-1.1.0.tar.gz#sha256=e6029526205d1f7cb535389bebd81decf0649a20ea6a67688c02bd335a7f9339 from build tracker '/tmp/pip-req-tracker-tlrzpmfb'\n",
            "Building wheels for collected packages: torch-spline-conv\n",
            "  Created temporary directory: /tmp/pip-wheel-2r5p9y4y\n",
            "  Building wheel for torch-spline-conv (setup.py) ... \u001b[?25l  Destination directory: /tmp/pip-wheel-2r5p9y4y\n",
            "  Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-qhlle6k3/torch-spline-conv/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-qhlle6k3/torch-spline-conv/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' bdist_wheel -d /tmp/pip-wheel-2r5p9y4y --python-tag cp36\n",
            "  running bdist_wheel\n",
            "  running build\n",
            "  running build_py\n",
            "  creating build\n",
            "  creating build/lib.linux-x86_64-3.6\n",
            "  creating build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_weighting.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/utils.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_basis.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/test_conv.py -> build/lib.linux-x86_64-3.6/test\n",
            "  copying test/__init__.py -> build/lib.linux-x86_64-3.6/test\n",
            "  creating build/lib.linux-x86_64-3.6/torch_spline_conv\n",
            "  copying torch_spline_conv/conv.py -> build/lib.linux-x86_64-3.6/torch_spline_conv\n",
            "  copying torch_spline_conv/basis.py -> build/lib.linux-x86_64-3.6/torch_spline_conv\n",
            "  copying torch_spline_conv/weighting.py -> build/lib.linux-x86_64-3.6/torch_spline_conv\n",
            "  copying torch_spline_conv/__init__.py -> build/lib.linux-x86_64-3.6/torch_spline_conv\n",
            "  creating build/lib.linux-x86_64-3.6/torch_spline_conv/utils\n",
            "  copying torch_spline_conv/utils/degree.py -> build/lib.linux-x86_64-3.6/torch_spline_conv/utils\n",
            "  copying torch_spline_conv/utils/__init__.py -> build/lib.linux-x86_64-3.6/torch_spline_conv/utils\n",
            "  running build_ext\n",
            "  building 'torch_spline_conv.basis_cpu' extension\n",
            "  creating build/temp.linux-x86_64-3.6\n",
            "  creating build/temp.linux-x86_64-3.6/cpu\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/basis.cpp -o build/temp.linux-x86_64-3.6/cpu/basis.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=basis_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/basis.o -o build/lib.linux-x86_64-3.6/torch_spline_conv/basis_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_spline_conv.weighting_cpu' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c cpu/weighting.cpp -o build/temp.linux-x86_64-3.6/cpu/weighting.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=weighting_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu/weighting.o -o build/lib.linux-x86_64-3.6/torch_spline_conv/weighting_cpu.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_spline_conv.basis_cuda' extension\n",
            "  creating build/temp.linux-x86_64-3.6/cuda\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/basis.cpp -o build/temp.linux-x86_64-3.6/cuda/basis.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=basis_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/basis_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/basis_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=basis_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/basis.o build/temp.linux-x86_64-3.6/cuda/basis_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_spline_conv/basis_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  building 'torch_spline_conv.weighting_cuda' extension\n",
            "  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/weighting.cpp -o build/temp.linux-x86_64-3.6/cuda/weighting.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=weighting_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/weighting_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/weighting_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=weighting_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11\n",
            "  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cuda/weighting.o build/temp.linux-x86_64-3.6/cuda/weighting_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/torch_spline_conv/weighting_cuda.cpython-36m-x86_64-linux-gnu.so\n",
            "  installing to build/bdist.linux-x86_64/wheel\n",
            "  running install\n",
            "  running install_lib\n",
            "  creating build/bdist.linux-x86_64\n",
            "  creating build/bdist.linux-x86_64/wheel\n",
            "  creating build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_weighting.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/utils.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_basis.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/test_conv.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  copying build/lib.linux-x86_64-3.6/test/__init__.py -> build/bdist.linux-x86_64/wheel/test\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/weighting_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/basis_cpu.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/basis_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_spline_conv/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/utils/degree.py -> build/bdist.linux-x86_64/wheel/torch_spline_conv/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/utils/__init__.py -> build/bdist.linux-x86_64/wheel/torch_spline_conv/utils\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/conv.py -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/basis.py -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/weighting.py -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/__init__.py -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  copying build/lib.linux-x86_64-3.6/torch_spline_conv/weighting_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/torch_spline_conv\n",
            "  running install_egg_info\n",
            "  running egg_info\n",
            "  writing torch_spline_conv.egg-info/PKG-INFO\n",
            "  writing dependency_links to torch_spline_conv.egg-info/dependency_links.txt\n",
            "  writing top-level names to torch_spline_conv.egg-info/top_level.txt\n",
            "  reading manifest file 'torch_spline_conv.egg-info/SOURCES.txt'\n",
            "  reading manifest template 'MANIFEST.in'\n",
            "  writing manifest file 'torch_spline_conv.egg-info/SOURCES.txt'\n",
            "  Copying torch_spline_conv.egg-info to build/bdist.linux-x86_64/wheel/torch_spline_conv-1.1.0-py3.6.egg-info\n",
            "  running install_scripts\n",
            "  adding license file \"LICENSE\" (matched pattern \"LICEN[CS]E*\")\n",
            "  creating build/bdist.linux-x86_64/wheel/torch_spline_conv-1.1.0.dist-info/WHEEL\n",
            "  creating '/tmp/pip-wheel-2r5p9y4y/torch_spline_conv-1.1.0-cp36-cp36m-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it\n",
            "  adding 'test/__init__.py'\n",
            "  adding 'test/test_basis.py'\n",
            "  adding 'test/test_conv.py'\n",
            "  adding 'test/test_weighting.py'\n",
            "  adding 'test/utils.py'\n",
            "  adding 'torch_spline_conv/__init__.py'\n",
            "  adding 'torch_spline_conv/basis.py'\n",
            "  adding 'torch_spline_conv/basis_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_spline_conv/basis_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_spline_conv/conv.py'\n",
            "  adding 'torch_spline_conv/weighting.py'\n",
            "  adding 'torch_spline_conv/weighting_cpu.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_spline_conv/weighting_cuda.cpython-36m-x86_64-linux-gnu.so'\n",
            "  adding 'torch_spline_conv/utils/__init__.py'\n",
            "  adding 'torch_spline_conv/utils/degree.py'\n",
            "  adding 'torch_spline_conv-1.1.0.dist-info/LICENSE'\n",
            "  adding 'torch_spline_conv-1.1.0.dist-info/METADATA'\n",
            "  adding 'torch_spline_conv-1.1.0.dist-info/WHEEL'\n",
            "  adding 'torch_spline_conv-1.1.0.dist-info/top_level.txt'\n",
            "  adding 'torch_spline_conv-1.1.0.dist-info/RECORD'\n",
            "  removing build/bdist.linux-x86_64/wheel\n",
            "\u001b[?25hdone\n",
            "  Created wheel for torch-spline-conv: filename=torch_spline_conv-1.1.0-cp36-cp36m-linux_x86_64.whl size=5263594 sha256=a0ce4589f203c2381e1923afb4121a5cfc14152a92096e69a1b7991ded3730ee\n",
            "  Stored in directory: /tmp/pip-ephem-wheel-cache-e749rsx1/wheels/c8/00/1f/9c414a9a5f340dd8d2e5e362d1bb5cad91fc7aec78c935fd66\n",
            "  Removing source in /tmp/pip-install-qhlle6k3/torch-spline-conv\n",
            "Successfully built torch-spline-conv\n",
            "Installing collected packages: torch-spline-conv\n",
            "\n",
            "Successfully installed torch-spline-conv-1.1.0\n",
            "Cleaning up...\n",
            "Removed build tracker '/tmp/pip-req-tracker-tlrzpmfb'\n",
            "Collecting torch-geometric\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/cc/b2/19eca95445f4657d6f164e3b57342f138780cca2b4a96a7f1a80707d778a/torch_geometric-1.3.0.tar.gz (102kB)\n",
            "\u001b[K     |████████████████████████████████| 112kB 4.8MB/s \n",
            "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from torch-geometric) (1.16.4)\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from torch-geometric) (1.3.0)\n",
            "Requirement already satisfied: networkx in /usr/local/lib/python3.6/dist-packages (from torch-geometric) (2.3)\n",
            "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.6/dist-packages (from torch-geometric) (0.21.3)\n",
            "Collecting plyfile (from torch-geometric)\n",
            "  Downloading https://files.pythonhosted.org/packages/9b/82/d4069cbb49954d44087c37ff616cb423d3e2c0dd276378cdb4af3e3ef2ee/plyfile-0.7.tar.gz\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.6/dist-packages (from torch-geometric) (0.24.2)\n",
            "Collecting rdflib (from torch-geometric)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/3c/fe/630bacb652680f6d481b9febbb3e2c3869194a1a5fc3401a4a41195a2f8f/rdflib-4.2.2-py3-none-any.whl (344kB)\n",
            "\u001b[K     |████████████████████████████████| 348kB 15.1MB/s \n",
            "\u001b[?25hRequirement already satisfied: h5py in /usr/local/lib/python3.6/dist-packages (from torch-geometric) (2.8.0)\n",
            "Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.6/dist-packages (from networkx->torch-geometric) (4.4.0)\n",
            "Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.6/dist-packages (from scikit-learn->torch-geometric) (0.13.2)\n",
            "Requirement already satisfied: python-dateutil>=2.5.0 in /usr/local/lib/python3.6/dist-packages (from pandas->torch-geometric) (2.5.3)\n",
            "Requirement already satisfied: pytz>=2011k in /usr/local/lib/python3.6/dist-packages (from pandas->torch-geometric) (2018.9)\n",
            "Collecting isodate (from rdflib->torch-geometric)\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl (45kB)\n",
            "\u001b[K     |████████████████████████████████| 51kB 27.9MB/s \n",
            "\u001b[?25hRequirement already satisfied: pyparsing in /usr/local/lib/python3.6/dist-packages (from rdflib->torch-geometric) (2.4.2)\n",
            "Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from h5py->torch-geometric) (1.12.0)\n",
            "Building wheels for collected packages: torch-geometric, plyfile\n",
            "  Building wheel for torch-geometric (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for torch-geometric: filename=torch_geometric-1.3.0-cp36-none-any.whl size=176110 sha256=7c67fb39ceeab859f9ba4f3ce13319a7924b15ffbacdeea1c813680b6539491c\n",
            "  Stored in directory: /root/.cache/pip/wheels/8b/4e/11/af2fec628d830776b6d49ad4df019d8200d138380d1fae39c2\n",
            "  Building wheel for plyfile (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for plyfile: filename=plyfile-0.7-cp36-none-any.whl size=8239 sha256=50ecb698e1ebf5dd3803405a2b2a58c41c65ae448af9cac4bdb90608525ca09e\n",
            "  Stored in directory: /root/.cache/pip/wheels/91/3e/ee/e5630ef0fd53cedaa6e911ba27e8b40fff034388d1f264bb92\n",
            "Successfully built torch-geometric plyfile\n",
            "Installing collected packages: plyfile, isodate, rdflib, torch-geometric\n",
            "Successfully installed isodate-0.6.0 plyfile-0.7 rdflib-4.2.2 torch-geometric-1.3.0\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "1P7b1Y0WaaLN",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import torch_geometric"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ijOMK-gFahn-",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import torch\n",
        "from torch.nn import Sequential as Seq, Linear, ReLU\n",
        "from torch_geometric.nn import MessagePassing\n",
        "from torch_geometric.utils import remove_self_loops, add_self_loops\n",
        "\n",
        "class SAGEConv(MessagePassing):\n",
        "    def __init__(self, in_channels, out_channels):\n",
        "        super(SAGEConv, self).__init__(aggr='max')\n",
        "        self.lin = torch.nn.Linear(in_channels, out_channels)\n",
        "        self.act = torch.nn.ReLU()\n",
        "        self.update_lin = torch.nn.Linear(in_channels + out_channels, in_channels, bias=False)\n",
        "        self.update_act = torch.nn.ReLU()\n",
        "        \n",
        "    def forward(self, x, edge_index):\n",
        "        # x has shape [N, in_channels]\n",
        "        # edge_index has shape [2, E]\n",
        "        \n",
        "        #添加自环\n",
        "        edge_index, _ = remove_self_loops(edge_index)\n",
        "        edge_index, _ = add_self_loops(edge_index, num_nodes=x.size(0))\n",
        "        \n",
        "        \n",
        "        return self.propagate(edge_index, size=(x.size(0), x.size(0)), x=x)  \n",
        "    \n",
        "    def message(self, x_j):\n",
        "        # x_j has shape [E, in_channels]\n",
        "          #将所有邻居节点转换到隐空间中，利用一个W 和 激活函数\n",
        "        x_j = self.lin(x_j)\n",
        "        x_j = self.act(x_j)\n",
        "        return x_j\n",
        "    # message return to  aggregation method\n",
        "    # here is max method\n",
        "    \n",
        "    #after aggr_out, then updata every node\n",
        "    #sageconv by cat and update_lin update_act\n",
        "    def update(self, aggr_out, x):\n",
        "        # aggr_out has shape [N, out_channels]\n",
        "        \n",
        "        new_embedding = torch.cat([aggr_out, x], dim=1)\n",
        "        new_embedding = self.update_lin(new_embedding)\n",
        "        new_embedding = torch.update_act(new_embedding)\n",
        "        \n",
        "        return new_embedding"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "1VOkz0PLjHYi",
        "colab_type": "code",
        "outputId": "0ae4c213-a89e-43f6-e6f3-5f14d8755cfd",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 222
        }
      },
      "source": [
        "!wget https://s3-eu-west-1.amazonaws.com/yc-rdata/yoochoose-data.7z"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "--2019-08-09 04:05:12--  https://s3-eu-west-1.amazonaws.com/yc-rdata/yoochoose-data.7z\n",
            "Resolving s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)... 52.218.96.82\n",
            "Connecting to s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)|52.218.96.82|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 287211932 (274M) [application/octet-stream]\n",
            "Saving to: ‘yoochoose-data.7z’\n",
            "\n",
            "yoochoose-data.7z   100%[===================>] 273.91M  20.4MB/s    in 14s     \n",
            "\n",
            "2019-08-09 04:05:27 (19.0 MB/s) - ‘yoochoose-data.7z’ saved [287211932/287211932]\n",
            "\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "poIHNMFIjac-",
        "colab_type": "text"
      },
      "source": [
        "# 新段落"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "mSbKirwzjisT",
        "colab_type": "code",
        "outputId": "a87e05e5-b42d-4b5b-cc0f-58b9b938ac64",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 423
        }
      },
      "source": [
        "!dir\n",
        "!7za x yoochoose-data.7z"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "sample_data  yoochoose-data.7z\n",
            "\n",
            "7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21\n",
            "p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Intel(R) Xeon(R) CPU @ 2.20GHz (406F0),ASM,AES-NI)\n",
            "\n",
            "Scanning the drive for archives:\n",
            "  0M Scan\b\b\b\b\b\b\b\b\b         \b\b\b\b\b\b\b\b\b1 file, 287211932 bytes (274 MiB)\n",
            "\n",
            "Extracting archive: yoochoose-data.7z\n",
            "--\n",
            "Path = yoochoose-data.7z\n",
            "Type = 7z\n",
            "Physical Size = 287211932\n",
            "Headers Size = 255\n",
            "Method = LZMA:24\n",
            "Solid = +\n",
            "Blocks = 2\n",
            "\n",
            "  0%\b\b\b\b    \b\b\b\b  0% - yoochoose-buys.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                         \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  1% - yoochoose-buys.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                         \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  2% - yoochoose-buys.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                         \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  3% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  4% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  5% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  6% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  7% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  8% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b  9% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 10% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 11% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 12% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 13% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 14% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 15% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 16% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 17% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 18% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 19% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 20% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 21% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 22% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 23% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 24% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 25% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 26% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 27% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 28% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 29% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 30% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 31% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 32% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 33% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 34% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 35% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 36% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 37% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 38% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 39% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 40% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 41% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 42% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 43% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 44% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 45% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 46% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 47% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 48% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 49% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 50% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 51% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 52% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 53% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 54% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 55% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 56% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 57% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 58% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 59% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 60% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 61% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 62% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 63% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 64% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 65% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 66% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 67% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 68% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 69% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 70% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 71% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 72% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 73% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 74% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 75% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 76% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 77% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 78% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 79% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 80% 1 - yoochoose-clicks.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                             \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 80% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 81% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 82% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 83% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 84% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 85% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 86% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 87% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 88% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 89% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 90% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 91% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 92% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 93% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 94% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 95% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 96% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 97% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 98% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 99% 2 - yoochoose-test.dat\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b                           \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 99% 3\b\b\b\b\b\b      \b\b\b\b\b\bEverything is Ok\n",
            "\n",
            "Files: 4\n",
            "Size:       1914111754\n",
            "Compressed: 287211932\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "c87ItY-skmTG",
        "colab_type": "code",
        "outputId": "a0397852-4f20-48c1-de2b-51bdf103fe09",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 50
        }
      },
      "source": [
        "!dir"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "dataset-README.txt  yoochoose-buys.dat\t  yoochoose-data.7z\n",
            "sample_data\t    yoochoose-clicks.dat  yoochoose-test.dat\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "rQIQBgu1kur7",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import numpy as np\n",
        "import pandas as pd\n",
        "import pickle\n",
        "import csv\n",
        "import os\n",
        "import torch\n",
        "from torch_geometric.data import Data"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ygOX6Crzkwpx",
        "colab_type": "code",
        "outputId": "3a166dbd-5ad1-4739-d39f-80620c0b43ed",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 249
        }
      },
      "source": [
        "np.random.seed(42)\n",
        "\n",
        "df = pd.read_csv('yoochoose-clicks.dat', header=None)\n",
        "df.columns=['session_id','timestamp','item_id','category']\n",
        "df.head(5)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py:2718: DtypeWarning: Columns (3) have mixed types. Specify dtype option on import or set low_memory=False.\n",
            "  interactivity=interactivity, compiler=compiler, result=result)\n"
          ],
          "name": "stderr"
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>session_id</th>\n",
              "      <th>timestamp</th>\n",
              "      <th>item_id</th>\n",
              "      <th>category</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>2014-04-07T10:51:09.277Z</td>\n",
              "      <td>214536502</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>1</td>\n",
              "      <td>2014-04-07T10:54:09.868Z</td>\n",
              "      <td>214536500</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>1</td>\n",
              "      <td>2014-04-07T10:54:46.998Z</td>\n",
              "      <td>214536506</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>1</td>\n",
              "      <td>2014-04-07T10:57:00.306Z</td>\n",
              "      <td>214577561</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>2</td>\n",
              "      <td>2014-04-07T13:56:37.614Z</td>\n",
              "      <td>214662742</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   session_id                 timestamp    item_id category\n",
              "0           1  2014-04-07T10:51:09.277Z  214536502        0\n",
              "1           1  2014-04-07T10:54:09.868Z  214536500        0\n",
              "2           1  2014-04-07T10:54:46.998Z  214536506        0\n",
              "3           1  2014-04-07T10:57:00.306Z  214577561        0\n",
              "4           2  2014-04-07T13:56:37.614Z  214662742        0"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 20
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "33JLNSigl0BZ",
        "colab_type": "code",
        "outputId": "ec52b2dc-d762-461e-85cf-38c447d2f321",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 639
        }
      },
      "source": [
        "buy_df = pd.read_csv('yoochoose-buys.dat', header=None)\n",
        "buy_df.columns=['session_id','timestamp','item_id','price','quantity']\n",
        "buy_df.head(20)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>session_id</th>\n",
              "      <th>timestamp</th>\n",
              "      <th>item_id</th>\n",
              "      <th>price</th>\n",
              "      <th>quantity</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>420374</td>\n",
              "      <td>2014-04-06T18:44:58.314Z</td>\n",
              "      <td>214537888</td>\n",
              "      <td>12462</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>420374</td>\n",
              "      <td>2014-04-06T18:44:58.325Z</td>\n",
              "      <td>214537850</td>\n",
              "      <td>10471</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>281626</td>\n",
              "      <td>2014-04-06T09:40:13.032Z</td>\n",
              "      <td>214535653</td>\n",
              "      <td>1883</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>420368</td>\n",
              "      <td>2014-04-04T06:13:28.848Z</td>\n",
              "      <td>214530572</td>\n",
              "      <td>6073</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>420368</td>\n",
              "      <td>2014-04-04T06:13:28.858Z</td>\n",
              "      <td>214835025</td>\n",
              "      <td>2617</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>140806</td>\n",
              "      <td>2014-04-07T09:22:28.132Z</td>\n",
              "      <td>214668193</td>\n",
              "      <td>523</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>140806</td>\n",
              "      <td>2014-04-07T09:22:28.176Z</td>\n",
              "      <td>214587399</td>\n",
              "      <td>1046</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>140806</td>\n",
              "      <td>2014-04-07T09:22:28.219Z</td>\n",
              "      <td>214586690</td>\n",
              "      <td>837</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>140806</td>\n",
              "      <td>2014-04-07T09:22:28.268Z</td>\n",
              "      <td>214774667</td>\n",
              "      <td>1151</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>140806</td>\n",
              "      <td>2014-04-07T09:22:28.280Z</td>\n",
              "      <td>214578823</td>\n",
              "      <td>1046</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>11</td>\n",
              "      <td>2014-04-03T11:04:11.417Z</td>\n",
              "      <td>214821371</td>\n",
              "      <td>1046</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>11</td>\n",
              "      <td>2014-04-03T11:04:18.097Z</td>\n",
              "      <td>214821371</td>\n",
              "      <td>1046</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>12</td>\n",
              "      <td>2014-04-02T10:42:17.227Z</td>\n",
              "      <td>214717867</td>\n",
              "      <td>1778</td>\n",
              "      <td>4</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>489758</td>\n",
              "      <td>2014-04-06T09:59:52.422Z</td>\n",
              "      <td>214826955</td>\n",
              "      <td>1360</td>\n",
              "      <td>2</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>489758</td>\n",
              "      <td>2014-04-06T09:59:52.476Z</td>\n",
              "      <td>214826715</td>\n",
              "      <td>732</td>\n",
              "      <td>2</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>489758</td>\n",
              "      <td>2014-04-06T09:59:52.578Z</td>\n",
              "      <td>214827026</td>\n",
              "      <td>1046</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>140802</td>\n",
              "      <td>2014-04-02T16:52:21.678Z</td>\n",
              "      <td>214716984</td>\n",
              "      <td>1883</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>489756</td>\n",
              "      <td>2014-04-05T16:51:59.947Z</td>\n",
              "      <td>214716932</td>\n",
              "      <td>6177</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>420378</td>\n",
              "      <td>2014-04-03T07:41:02.566Z</td>\n",
              "      <td>214821017</td>\n",
              "      <td>1046</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>420378</td>\n",
              "      <td>2014-04-03T07:41:02.616Z</td>\n",
              "      <td>214821020</td>\n",
              "      <td>732</td>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "    session_id                 timestamp    item_id  price  quantity\n",
              "0       420374  2014-04-06T18:44:58.314Z  214537888  12462         1\n",
              "1       420374  2014-04-06T18:44:58.325Z  214537850  10471         1\n",
              "2       281626  2014-04-06T09:40:13.032Z  214535653   1883         1\n",
              "3       420368  2014-04-04T06:13:28.848Z  214530572   6073         1\n",
              "4       420368  2014-04-04T06:13:28.858Z  214835025   2617         1\n",
              "5       140806  2014-04-07T09:22:28.132Z  214668193    523         1\n",
              "6       140806  2014-04-07T09:22:28.176Z  214587399   1046         1\n",
              "7       140806  2014-04-07T09:22:28.219Z  214586690    837         1\n",
              "8       140806  2014-04-07T09:22:28.268Z  214774667   1151         1\n",
              "9       140806  2014-04-07T09:22:28.280Z  214578823   1046         1\n",
              "10          11  2014-04-03T11:04:11.417Z  214821371   1046         1\n",
              "11          11  2014-04-03T11:04:18.097Z  214821371   1046         1\n",
              "12          12  2014-04-02T10:42:17.227Z  214717867   1778         4\n",
              "13      489758  2014-04-06T09:59:52.422Z  214826955   1360         2\n",
              "14      489758  2014-04-06T09:59:52.476Z  214826715    732         2\n",
              "15      489758  2014-04-06T09:59:52.578Z  214827026   1046         1\n",
              "16      140802  2014-04-02T16:52:21.678Z  214716984   1883         1\n",
              "17      489756  2014-04-05T16:51:59.947Z  214716932   6177         1\n",
              "18      420378  2014-04-03T07:41:02.566Z  214821017   1046         1\n",
              "19      420378  2014-04-03T07:41:02.616Z  214821020    732         1"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 21
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "WH6mmA3Ol4dm",
        "colab_type": "code",
        "outputId": "f8f7e5d2-f6c8-4b12-a1cd-1b589934376d",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 118
        }
      },
      "source": [
        "buy_df.nunique()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "session_id     509696\n",
              "timestamp     1136477\n",
              "item_id         19949\n",
              "price             735\n",
              "quantity           28\n",
              "dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 22
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "n_cMK8E7l606",
        "colab_type": "code",
        "outputId": "d2d1238a-5e56-4828-a1e0-dafb98fb3901",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 101
        }
      },
      "source": [
        "df.nunique()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "session_id     9249729\n",
              "timestamp     32937845\n",
              "item_id          52739\n",
              "category           340\n",
              "dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 23
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "XaIzC4qmmspS",
        "colab_type": "code",
        "outputId": "9ce0418b-5d08-4ea6-a67f-dc5e5790e764",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 101
        }
      },
      "source": [
        "df['valid_session'] = df.session_id.map(df.groupby('session_id')['item_id'].size() > 2)\n",
        "df = df.loc[df.valid_session].drop('valid_session',axis=1)\n",
        "df.nunique()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "session_id     4431931\n",
              "timestamp     24590089\n",
              "item_id          48255\n",
              "category           331\n",
              "dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 24
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "srqkCyl3m4ES",
        "colab_type": "code",
        "outputId": "bd22c90a-501d-4ce5-c6c6-a748f7ef29b6",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 101
        }
      },
      "source": [
        "# #randomly sample a couple of them\n",
        "sampled_session_id = np.random.choice(df.session_id.unique(), 1000000, replace=False)\n",
        "df = df.loc[df.session_id.isin(sampled_session_id)]\n",
        "df.nunique()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "session_id    1000000\n",
              "timestamp     5546275\n",
              "item_id         37353\n",
              "category          260\n",
              "dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 25
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "iWNu_Adxm6I3",
        "colab_type": "code",
        "outputId": "ae4ee713-d226-4535-ea6e-5f96655b97a4",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 101
        }
      },
      "source": [
        "df.isna().sum()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "session_id    0\n",
              "timestamp     0\n",
              "item_id       0\n",
              "category      0\n",
              "dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 26
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "s70A2RTam62F",
        "colab_type": "code",
        "outputId": "bbfef99e-21cb-427f-b079-592ca06eb91d",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "# average length of session \n",
        "df.groupby('session_id')['item_id'].size().mean()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "5.548274"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 27
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "2zegOtHLm_Kr",
        "colab_type": "code",
        "outputId": "020991bd-c7b1-4740-86c8-e4956e1e1622",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 195
        }
      },
      "source": [
        "from sklearn.preprocessing import LabelEncoder\n",
        "\n",
        "item_encoder = LabelEncoder()\n",
        "df['item_id'] = item_encoder.fit_transform(df.item_id)\n",
        "df.head()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>session_id</th>\n",
              "      <th>timestamp</th>\n",
              "      <th>item_id</th>\n",
              "      <th>category</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>3</td>\n",
              "      <td>2014-04-02T13:17:46.940Z</td>\n",
              "      <td>21302</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>3</td>\n",
              "      <td>2014-04-02T13:26:02.515Z</td>\n",
              "      <td>25022</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>3</td>\n",
              "      <td>2014-04-02T13:30:12.318Z</td>\n",
              "      <td>29039</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>49</th>\n",
              "      <td>19</td>\n",
              "      <td>2014-04-01T20:52:12.357Z</td>\n",
              "      <td>5749</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>50</th>\n",
              "      <td>19</td>\n",
              "      <td>2014-04-01T20:52:13.758Z</td>\n",
              "      <td>5749</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "    session_id                 timestamp  item_id category\n",
              "10           3  2014-04-02T13:17:46.940Z    21302        0\n",
              "11           3  2014-04-02T13:26:02.515Z    25022        0\n",
              "12           3  2014-04-02T13:30:12.318Z    29039        0\n",
              "49          19  2014-04-01T20:52:12.357Z     5749        0\n",
              "50          19  2014-04-01T20:52:13.758Z     5749        0"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 28
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "PTOA2YOJnC6E",
        "colab_type": "code",
        "outputId": "cfdda438-42c9-4957-ec49-e34156876eda",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 195
        }
      },
      "source": [
        "df['label'] = df.session_id.isin(buy_df.session_id)\n",
        "df.head()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>session_id</th>\n",
              "      <th>timestamp</th>\n",
              "      <th>item_id</th>\n",
              "      <th>category</th>\n",
              "      <th>label</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>3</td>\n",
              "      <td>2014-04-02T13:17:46.940Z</td>\n",
              "      <td>21302</td>\n",
              "      <td>0</td>\n",
              "      <td>False</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>3</td>\n",
              "      <td>2014-04-02T13:26:02.515Z</td>\n",
              "      <td>25022</td>\n",
              "      <td>0</td>\n",
              "      <td>False</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>3</td>\n",
              "      <td>2014-04-02T13:30:12.318Z</td>\n",
              "      <td>29039</td>\n",
              "      <td>0</td>\n",
              "      <td>False</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>49</th>\n",
              "      <td>19</td>\n",
              "      <td>2014-04-01T20:52:12.357Z</td>\n",
              "      <td>5749</td>\n",
              "      <td>0</td>\n",
              "      <td>False</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>50</th>\n",
              "      <td>19</td>\n",
              "      <td>2014-04-01T20:52:13.758Z</td>\n",
              "      <td>5749</td>\n",
              "      <td>0</td>\n",
              "      <td>False</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "    session_id                 timestamp  item_id category  label\n",
              "10           3  2014-04-02T13:17:46.940Z    21302        0  False\n",
              "11           3  2014-04-02T13:26:02.515Z    25022        0  False\n",
              "12           3  2014-04-02T13:30:12.318Z    29039        0  False\n",
              "49          19  2014-04-01T20:52:12.357Z     5749        0  False\n",
              "50          19  2014-04-01T20:52:13.758Z     5749        0  False"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 29
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "P3NKzJoGnX0o",
        "colab_type": "code",
        "outputId": "871f13dc-e1b2-4eed-c8e9-d08eb067c935",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "df.drop_duplicates('session_id')['label'].mean()"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "0.085507"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 30
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "kukO8RPrnam9",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import torch\n",
        "from torch_geometric.data import InMemoryDataset\n",
        "from tqdm import tqdm\n",
        "\n",
        "class YooChooseBinaryDataset(InMemoryDataset):\n",
        "    def __init__(self, root, transform=None, pre_transform=None):\n",
        "        super(YooChooseBinaryDataset, self).__init__(root, transform, pre_transform)\n",
        "        self.data, self.slices = torch.load(self.processed_paths[0])\n",
        "\n",
        "    @property\n",
        "    def raw_file_names(self):\n",
        "        return []\n",
        "    @property\n",
        "    def processed_file_names(self):\n",
        "        return ['yoochoose_click_binary_1M_sess.dataset']\n",
        "\n",
        "    def download(self):\n",
        "        pass\n",
        "    \n",
        "    def process(self):\n",
        "        \n",
        "        data_list = []\n",
        "\n",
        "        # process by session_id\n",
        "        grouped = df.groupby('session_id')\n",
        "        for session_id, group in tqdm(grouped):\n",
        "            sess_item_id = LabelEncoder().fit_transform(group.item_id)\n",
        "            group = group.reset_index(drop=True)\n",
        "            group['sess_item_id'] = sess_item_id\n",
        "            node_features = group.loc[group.session_id==session_id,['sess_item_id','item_id']].sort_values('sess_item_id').item_id.drop_duplicates().values\n",
        "\n",
        "            node_features = torch.LongTensor(node_features).unsqueeze(1)\n",
        "            target_nodes = group.sess_item_id.values[1:]\n",
        "            source_nodes = group.sess_item_id.values[:-1]\n",
        "\n",
        "            edge_index = torch.tensor([source_nodes,\n",
        "                                   target_nodes], dtype=torch.long)\n",
        "            x = node_features\n",
        "\n",
        "            y = torch.FloatTensor([group.label.values[0]])\n",
        "\n",
        "            data = Data(x=x, edge_index=edge_index, y=y)\n",
        "            data_list.append(data)\n",
        "        \n",
        "        data, slices = self.collate(data_list)\n",
        "        torch.save((data, slices), self.processed_paths[0])"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "8hvFp8P2rjaH",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Dl1j9OdFnj9A",
        "colab_type": "code",
        "outputId": "477b8023-3576-4930-d275-9ed0f5f6dbcf",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 67
        }
      },
      "source": [
        "dataset = YooChooseBinaryDataset(root='')\n"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Processing...\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "stream",
          "text": [
            "100%|██████████| 1000000/1000000 [1:12:02<00:00, 231.37it/s]\n"
          ],
          "name": "stderr"
        },
        {
          "output_type": "stream",
          "text": [
            "Done!\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "vrTNLS0bJYSM",
        "colab_type": "code",
        "outputId": "274b0dae-3bd3-4e09-f598-4f1d2056814d",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "dataset_2 = YooChooseBinaryDataset(root='')\n"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([0.])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 56
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ybNKNNhsKIA7",
        "colab_type": "code",
        "outputId": "10412860-d7f1-41db-dd22-6e67f2552352",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 50
        }
      },
      "source": [
        "dataset_2[100].edge_index"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([[3, 6, 0, 4, 5, 4, 2, 1],\n",
              "        [6, 0, 4, 5, 4, 2, 1, 1]])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 57
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "nudhvzZL4sQY",
        "colab_type": "code",
        "outputId": "bf4128ea-78d6-4653-d208-72b12aea7030",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "dataset = dataset.shuffle()\n",
        "train_dataset = dataset[:800000]\n",
        "val_dataset = dataset[800000:900000]\n",
        "test_dataset = dataset[900000:]\n",
        "len(train_dataset), len(val_dataset), len(test_dataset)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(800000, 100000, 100000)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 65
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "vXZxfdNO4unB",
        "colab_type": "code",
        "outputId": "93237096-88a8-4c06-e635-a882013a923a",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "from torch_geometric.data import DataLoader\n",
        "batch_size= 128\n",
        "train_loader = DataLoader(train_dataset, batch_size=batch_size)\n",
        "val_loader = DataLoader(val_dataset, batch_size=batch_size)\n",
        "test_loader = DataLoader(test_dataset, batch_size=batch_size)\n",
        "num_items = df.item_id.max() +1 \n",
        "num_items"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "37353"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 59
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0JU0d17-6st9",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import torch\n",
        "from torch.nn import Sequential as Seq, Linear, ReLU\n",
        "import torch.nn.functional as F\n",
        "from torch_geometric.nn import MessagePassing\n",
        "from torch_geometric.utils import remove_self_loops, add_self_loops\n",
        "class SAGEConv(MessagePassing):\n",
        "    def __init__(self, in_channels, out_channels):\n",
        "        super(SAGEConv, self).__init__(aggr='max') #  \"Max\" aggregation.\n",
        "        self.lin = torch.nn.Linear(in_channels, out_channels)\n",
        "        self.act = torch.nn.ReLU()\n",
        "        self.update_lin = torch.nn.Linear(in_channels + out_channels, in_channels, bias=False)\n",
        "        self.update_act = torch.nn.ReLU()\n",
        "        \n",
        "    def forward(self, x, edge_index):\n",
        "        # x has shape [N, in_channels]\n",
        "        # edge_index has shape [2, E]\n",
        "        \n",
        "        \n",
        "        edge_index, _ = remove_self_loops(edge_index)\n",
        "        edge_index, _ = add_self_loops(edge_index, num_nodes=x.size(0))\n",
        "        \n",
        "        \n",
        "        return self.propagate(edge_index, size=(x.size(0), x.size(0)), x=x)\n",
        "\n",
        "    def message(self, x_j):\n",
        "        # x_j has shape [E, in_channels]\n",
        "\n",
        "        x_j = self.lin(x_j)\n",
        "        x_j = self.act(x_j)\n",
        "        \n",
        "        return x_j\n",
        "\n",
        "    def update(self, aggr_out, x):\n",
        "        # aggr_out has shape [N, out_channels]\n",
        "\n",
        "\n",
        "        new_embedding = torch.cat([aggr_out, x], dim=1)\n",
        "        \n",
        "        new_embedding = self.update_lin(new_embedding)\n",
        "        new_embedding = self.update_act(new_embedding)\n",
        "        #normalize\n",
        "        new_embedding = F.normalize(new_embedding, p=2, dim=-1)\n",
        "        return new_embedding"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "iUr79Nwd6xNp",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "embed_dim = 128\n",
        "from torch_geometric.nn import GraphConv, TopKPooling, GatedGraphConv\n",
        "from torch_geometric.nn import global_mean_pool as gap, global_max_pool as gmp\n",
        "import torch.nn.functional as F\n",
        "class Net(torch.nn.Module):\n",
        "    def __init__(self):\n",
        "        super(Net, self).__init__()\n",
        "\n",
        "        self.conv1 = SAGEConv(embed_dim, 128)\n",
        "        self.pool1 = TopKPooling(128, ratio=0.8)\n",
        "        self.conv2 = SAGEConv(128, 128)\n",
        "        self.pool2 = TopKPooling(128, ratio=0.8)\n",
        "        self.conv3 = SAGEConv(128, 128)\n",
        "        self.pool3 = TopKPooling(128, ratio=0.8)\n",
        "        self.item_embedding = torch.nn.Embedding(num_embeddings=df.item_id.max() +1, embedding_dim=embed_dim)\n",
        "        self.lin1 = torch.nn.Linear(256, 128)\n",
        "        self.lin2 = torch.nn.Linear(128, 64)\n",
        "        self.lin3 = torch.nn.Linear(64, 1)\n",
        "        self.bn1 = torch.nn.BatchNorm1d(128)\n",
        "        self.bn2 = torch.nn.BatchNorm1d(64)\n",
        "        self.act1 = torch.nn.ReLU()\n",
        "        self.act2 = torch.nn.ReLU()   \n",
        "    def forward(self, data):\n",
        "        x, edge_index, batch = data.x, data.edge_index, data.batch\n",
        "        #将数据映射到隐空间\n",
        "        x = self.item_embedding(x)\n",
        "        x = x.squeeze(1)        \n",
        "\n",
        "        x = F.relu(self.conv1(x, edge_index))\n",
        "\n",
        "        x, edge_index, _, batch, _ = self.pool1(x, edge_index, None, batch)\n",
        "        x1 = torch.cat([gmp(x, batch), gap(x, batch)], dim=1)\n",
        "\n",
        "        x = F.relu(self.conv2(x, edge_index))\n",
        "        x, edge_index, _, batch, _ = self.pool2(x, edge_index, None, batch)\n",
        "        x2 = torch.cat([gmp(x, batch), gap(x, batch)], dim=1)\n",
        "\n",
        "        x = F.relu(self.conv3(x, edge_index))\n",
        "\n",
        "        x, edge_index, _, batch, _ = self.pool3(x, edge_index, None, batch)\n",
        "        x3 = torch.cat([gmp(x, batch), gap(x, batch)], dim=1)\n",
        "\n",
        "        #skip connection？ 多层的特征相融合\n",
        "        x = x1 + x2 + x3\n",
        "\n",
        "        x = self.lin1(x)\n",
        "        x = self.act1(x)\n",
        "        #x = F.dropout(x, p=0.5, training=self.training)\n",
        "        \n",
        "        x = self.lin2(x)  \n",
        "        x = self.act2(x)      \n",
        "        x = F.dropout(x, p=0.5, training=self.training)\n",
        "\n",
        "        x = torch.sigmoid(self.lin3(x)).squeeze(1)\n",
        "\n",
        "        return x"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "oCR700Tb6-UA",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "device = torch.device('cuda')\n",
        "model = Net().to(device)\n",
        "optimizer = torch.optim.Adam(model.parameters(), lr=0.005)\n",
        "crit = torch.nn.BCELoss()"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "jen0Xjzd7BOx",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "def train():\n",
        "    model.train()\n",
        "\n",
        "    loss_all = 0\n",
        "    for data in train_loader:\n",
        "        data = data.to(device)\n",
        "        optimizer.zero_grad()\n",
        "        output = model(data)\n",
        "        label = data.y.to(device)\n",
        "        loss = crit(output, label)\n",
        "        loss.backward()\n",
        "        loss_all += data.num_graphs * loss.item()\n",
        "        optimizer.step()\n",
        "    return loss_all / len(train_dataset)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "r39TedEs7F5j",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "from sklearn.metrics import roc_auc_score\n",
        "def evaluate(loader):\n",
        "    model.eval()\n",
        "\n",
        "    predictions = []\n",
        "    labels = []\n",
        "\n",
        "    with torch.no_grad():\n",
        "        for data in loader:\n",
        "\n",
        "            data = data.to(device)\n",
        "            pred = model(data).detach().cpu().numpy()\n",
        "\n",
        "            label = data.y.detach().cpu().numpy()\n",
        "            predictions.append(pred)\n",
        "            labels.append(label)\n",
        "\n",
        "    predictions = np.hstack(predictions)\n",
        "    labels = np.hstack(labels)\n",
        "    \n",
        "    return roc_auc_score(labels, predictions)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "snFGkcO57Gx2",
        "colab_type": "code",
        "outputId": "ae9a045b-d390-40f5-d9e7-9826680384c0",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 185
        }
      },
      "source": [
        "for epoch in range(10):\n",
        "    loss = train()\n",
        "    train_acc = evaluate(train_loader)\n",
        "    val_acc = evaluate(val_loader)    \n",
        "    test_acc = evaluate(test_loader)\n",
        "    print('Epoch: {:03d}, Loss: {:.5f}, Train Auc: {:.5f}, Val Auc: {:.5f}, Test Auc: {:.5f}'.\n",
        "          format(epoch, loss, train_acc, val_acc, test_acc))"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Epoch: 000, Loss: 0.02983, Train Auc: 0.76859, Val Auc: 0.61816, Test Auc: 0.64235\n",
            "Epoch: 001, Loss: 0.02620, Train Auc: 0.83039, Val Auc: 0.63048, Test Auc: 0.64727\n",
            "Epoch: 002, Loss: 0.02238, Train Auc: 0.82772, Val Auc: 0.62684, Test Auc: 0.64288\n",
            "Epoch: 003, Loss: 0.01936, Train Auc: 0.82168, Val Auc: 0.61601, Test Auc: 0.62219\n",
            "Epoch: 004, Loss: 0.01700, Train Auc: 0.81765, Val Auc: 0.60891, Test Auc: 0.61875\n",
            "Epoch: 005, Loss: 0.01545, Train Auc: 0.83257, Val Auc: 0.60955, Test Auc: 0.62181\n",
            "Epoch: 006, Loss: 0.01421, Train Auc: 0.84175, Val Auc: 0.60962, Test Auc: 0.61632\n",
            "Epoch: 007, Loss: 0.01295, Train Auc: 0.85735, Val Auc: 0.60562, Test Auc: 0.60049\n",
            "Epoch: 008, Loss: 0.01178, Train Auc: 0.87715, Val Auc: 0.61137, Test Auc: 0.61224\n",
            "Epoch: 009, Loss: 0.01073, Train Auc: 0.90759, Val Auc: 0.61613, Test Auc: 0.62023\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "NJyY3tqPBVS7",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "# 指定Google Drive云端硬盘的根目录，名为drive\n",
        "!mkdir -p drive\n",
        "!google-drive-ocamlfuse drive"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Dz2iEiltBbgU",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!cp -r /content/processed/yoochoose_click_binary_1M_sess.dataset /content/drive"
      ],
      "execution_count": 0,
      "outputs": []
    }
  ]
}